summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2021-09-21 17:20:32 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2021-09-21 17:20:32 -0400
commit68e4d1fe28e0747ecece2ef6768e5c6cdb7db4f4 (patch)
tree3cb2e8188a9020edc5997f7a4531e3ad02459512
parentef97d5c407757d2b190a576f1f86330db6be036d (diff)
downloadb4-68e4d1fe28e0747ecece2ef6768e5c6cdb7db4f4.tar.gz
Simplify sparse worktree preparation
Looks like we don't need to have the files in place to run "git am", so skip that step and just init the sparsest possible tree. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r--b4/mbox.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/b4/mbox.py b/b4/mbox.py
index 3e3ae05..96e2d04 100644
--- a/b4/mbox.py
+++ b/b4/mbox.py
@@ -262,13 +262,8 @@ def make_am(msgs, cmdargs, msgid):
base_commit = 'HEAD'
with b4.git_temp_worktree(topdir, base_commit) as gwt:
- if lser.indexes is None:
- lser.populate_indexes()
- # TODO: Handle patches containing nothing but new file additions
- wantfiles = [i[0] for i in lser.indexes]
- logger.info('Magic: Preparing a sparse worktree with %s files', len(wantfiles))
- # TODO: Handle these potential errors
- ecode, out = b4.git_run_command(gwt, ['sparse-checkout', 'init'] + wantfiles, logstderr=True)
+ logger.info('Magic: Preparing a sparse worktree')
+ ecode, out = b4.git_run_command(gwt, ['sparse-checkout', 'init'], logstderr=True)
if ecode > 0:
logger.critical('Error running sparse-checkout init')
logger.critical(out)
@@ -314,7 +309,6 @@ def make_am(msgs, cmdargs, msgid):
logger.critical(' git am %s', am_filename)
-
def thanks_record_am(lser, cherrypick=None):
# Are we tracking this already?
datadir = b4.get_data_dir()