From: Catalin Marinas Date: Thu, 17 Apr 2008 20:49:29 +0000 (+0100) Subject: Fix the sync'ing of unapplied patches only X-Git-Tag: v0.14.3~7 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/commitdiff_plain/61fb81b963c1adb0abb08239c24fa4ee39c5929a?hp=-c Fix the sync'ing of unapplied patches only When only unapplied patches are to be sync'ed, the command failed because the first patch was trying to be pushed twice. Signed-off-by: Catalin Marinas --- 61fb81b963c1adb0abb08239c24fa4ee39c5929a diff --git a/stgit/commands/sync.py b/stgit/commands/sync.py index ae9a5f8..a04ff82 100644 --- a/stgit/commands/sync.py +++ b/stgit/commands/sync.py @@ -136,11 +136,13 @@ def func(parser, options, args): to_pop = applied[applied.index(first_patch) + 1:] if to_pop: pop_patches(crt_series, to_pop[::-1]) + pushed = [first_patch] else: to_pop = [] + pushed = [] popped = to_pop + [p for p in patches if p in unapplied] - for p in [first_patch] + popped: + for p in pushed + popped: if p in popped: # push this patch push_patches(crt_series, [p])