From: Chuck Lever Date: Fri, 2 Dec 2005 00:15:13 +0000 (-0500) Subject: Fast-forwarding does a git.switch() even when it forwarded no patches X-Git-Tag: v0.14.3~568 X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/commitdiff_plain/06dbe79199c668308befef3539a64d2242c861c1 Fast-forwarding does a git.switch() even when it forwarded no patches 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 --- diff --git a/stgit/stack.py b/stgit/stack.py index dc7c19f..bc5915e 100644 --- a/stgit/stack.py +++ b/stgit/stack.py @@ -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])