Fast-forwarding does a git.switch() even when it forwarded no patches
[stgit] / stgit / stack.py
index dc7c19f..bc5915e 100644 (file)
@@ -635,6 +635,9 @@ class Series:
             forwarded+=1
             unapplied.remove(name)
 
+        if forwarded == 0:
+            return 0
+
         git.switch(top)
 
         append_strings(self.__applied_file, names[0:forwarded])