[StGit PATCH] Do not crash if a patch log ref is missing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since we'll get rid of the individual patch logs, StGit should ignore if
such a ref is missing when deleting the compatibility patch files.

Signed-off-by: Catalin Marinas <catalin.marinas@xxxxxxxxx>
---
 stgit/lib/stack.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/stgit/lib/stack.py b/stgit/lib/stack.py
index 9cb3967..1059955 100644
--- a/stgit/lib/stack.py
+++ b/stgit/lib/stack.py
@@ -68,7 +68,11 @@ class Patch(object):
             for f in os.listdir(self.__compat_dir):
                 os.remove(os.path.join(self.__compat_dir, f))
             os.rmdir(self.__compat_dir)
-        self.__stack.repository.refs.delete(self.__log_ref)
+        try:
+            # this compatibility log ref might not exist
+            self.__stack.repository.refs.delete(self.__log_ref)
+        except KeyError:
+            pass
     def set_commit(self, commit, msg):
         self.__write_compat_files(commit, msg)
         self.__stack.repository.refs.set(self.__ref, commit, msg)

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux