From 68e4d1fe28e0747ecece2ef6768e5c6cdb7db4f4 Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Tue, 21 Sep 2021 17:20:32 -0400 Subject: 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 --- b4/mbox.py | 10 ++-------- 1 file 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() -- cgit v1.2.3