From: Karl Hasselstr\öm Date: Fri, 17 Feb 2006 21:31:44 +0000 (+0000) Subject: Update .git/refs/heads/base after patch deletion X-Git-Tag: v0.14.3~542 X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/commitdiff_plain/2b4b9c29d1bc5d98eafdfdc82b99b57ebd4298d0?hp=51cb39dbf3530655ed5af69b135e5b4edb4b7f4f Update .git/refs/heads/base after patch deletion 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 --- diff --git a/stgit/stack.py b/stgit/stack.py index 556c40e..9ccbb1e 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): @@ -694,6 +695,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.