git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
CMCatalin Marinas <catalin.marinas@gmail.com>
Date
Sep 12, 2008, 21:54 UTC
Message-ID
<20080912215449.10270.38860.stgit@localhost.localdomain>

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@gmail.com>
---
 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)
Next: Karl Hasselström
Message 1 of 3 in “Do not crash if a patch log ref is missing”
  1. Do not crash if a patch log ref is missingCatalin Marinas, Sep 12, 2008
  2. Karl HasselströmSep 14, 2008
  3. Catalin MarinasSep 14, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.