1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-11-01 19:05:51 +01:00

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>
This commit is contained in:
Simon Glass
2020-07-05 21:41:51 -06:00
parent fd70986a62
commit 262130f57c
5 changed files with 40 additions and 15 deletions

View File

@@ -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)