Thread (29 messages) flat view 29 messages, 9 authors, 2016-06-15
DORMANTno replies

[PATCH 1/2] Update .git/refs/heads/base after patch deletion

From: Karl Hasselström <hidden>
Date: 2016-06-15 22:42:19
Subsystem: the rest · Maintainer: Linus Torvalds

Save the current HEAD into refs/heads/base if the stack is empty after
a patch has been deleted. This was not done before, which caused
refs/heads/base to not be updated after 'stg commit'. To guard against
existing repositories with no applied patches and HEAD !=
refs/heads/base, also do the update every time someone asks for the
name of refs/heads/base.

Signed-off-by: Karl Hasselström <redacted>

---

 stgit/stack.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/stgit/stack.py b/stgit/stack.py
index 68a2936..bc39d14 100644
--- a/stgit/stack.py
+++ b/stgit/stack.py
@@ -366,6 +366,7 @@ class Series:
         return names
 
     def get_base_file(self):
+        self.__begin_stack_check()
         return self.__base_file
 
     def get_protected(self):
@@ -686,6 +687,7 @@ class Series:
         f = file(self.__unapplied_file, 'w+')
         f.writelines([line + '\n' for line in unapplied])
         f.close()
+        self.__begin_stack_check()
 
     def forward_patches(self, names):
         """Try to fast-forward an array of patches.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help