Fast-forwarding does a git.switch() even when it forwarded no patches
authorChuck Lever <cel@netapp.com>
Fri, 2 Dec 2005 00:15:13 +0000 (19:15 -0500)
committerCatalin Marinas <catalin.marinas@gmail.com>
Fri, 2 Dec 2005 21:47:00 +0000 (21:47 +0000)
The git.switch() in forward_patches() is not needed when no patches have
been fast forwarded.  This is a significant speed up.

Signed-off-by: Chuck Lever <cel@netapp.com>
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])