aboutsummaryrefslogtreecommitdiff
path: root/tools/patman/func_test.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-07-05 21:41:51 -0600
committerSimon Glass <sjg@chromium.org>2020-07-20 11:37:46 -0600
commite9799e0890339dcf9f816f7b904147f791fca011 (patch)
treeef6907830bc90d3c760eabc11ca4740507cee51b /tools/patman/func_test.py
parent5d597584dbf027ce3e87d06001f5cbc2bde26eb2 (diff)
downloadu-boot-e9799e0890339dcf9f816f7b904147f791fca011.zip
u-boot-e9799e0890339dcf9f816f7b904147f791fca011.tar.gz
u-boot-e9799e0890339dcf9f816f7b904147f791fca011.tar.bz2
patman: Allow creating patches for another branch
Add a -b option to allow patches to be created from a branch other than the current one. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/patman/func_test.py')
-rw-r--r--tools/patman/func_test.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/tools/patman/func_test.py b/tools/patman/func_test.py
index 2119521..588be73e 100644
--- a/tools/patman/func_test.py
+++ b/tools/patman/func_test.py
@@ -426,12 +426,21 @@ complicated as possible''')
os.chdir(self.gitdir)
# Check that it can detect the current branch
- self.assertEqual(2, gitutil.CountCommitsToBranch())
+ self.assertEqual(2, gitutil.CountCommitsToBranch(None))
col = terminal.Color()
with capture_sys_output() as _:
_, cover_fname, patch_files = control.prepare_patches(
- col, count=-1, start=0, ignore_binary=False)
+ col, branch=None, count=-1, start=0, ignore_binary=False)
self.assertIsNone(cover_fname)
self.assertEqual(2, len(patch_files))
+
+ # Check that it can detect a different branch
+ self.assertEqual(3, gitutil.CountCommitsToBranch('second'))
+ with capture_sys_output() as _:
+ _, cover_fname, patch_files = control.prepare_patches(
+ col, branch='second', count=-1, start=0,
+ ignore_binary=False)
+ self.assertIsNotNone(cover_fname)
+ self.assertEqual(3, len(patch_files))
finally:
os.chdir(orig_dir)