chiark / gitweb /
Fix the sync'ing of unapplied patches only
authorCatalin Marinas <catalin.marinas@gmail.com>
Thu, 17 Apr 2008 20:49:29 +0000 (21:49 +0100)
committerCatalin Marinas <catalin.marinas@gmail.com>
Thu, 17 Apr 2008 20:49:29 +0000 (21:49 +0100)
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 <catalin.marinas@gmail.com>
stgit/commands/sync.py

index ae9a5f87e7e48e04e791ee057f141a8b97eec317..a04ff8231020b0adf400d3f3dcb572205ff5f700 100644 (file)
@@ -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])