chiark / gitweb /
Fix the push_patch function to not always call refresh_patch
authorCatalin Marinas <catalin.marinas@gmail.com>
Tue, 23 Aug 2005 09:07:22 +0000 (10:07 +0100)
committerCatalin Marinas <catalin.marinas@gmail.com>
Tue, 23 Aug 2005 09:07:22 +0000 (10:07 +0100)
The refresh_patch() function should only be called when there was a
merge operation, otherwise push_patch() should only checkout the new
head.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
stgit/stack.py

index 71f038d84bb56746a57ea185f17c7670b89b9930..ef7e3f6d2b62e4b118fff13c8c42775277f92b7d 100644 (file)
@@ -481,11 +481,13 @@ class Series:
 
         self.__set_current(name)
 
-        if not ex:
-            # if the merge was OK and no conflicts, just refresh the patch
-            self.refresh_patch()
-        else:
-            raise StackException, str(ex)
+        # head == bottom case doesn't need to refresh the patch
+        if head != bottom:
+            if not ex:
+                # if the merge was OK and no conflicts, just refresh the patch
+                self.refresh_patch()
+            else:
+                raise StackException, str(ex)
 
     def undo_push(self):
         name = self.get_current()