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

[StGIT PATCH 2/4] Don't write None to the conf file

From
Karl Hasselström <kha@treskal.com>
Date
Aug 26, 2007, 20:26 UTC
Message-ID
<20070826202620.15933.51552.stgit@yoghurt>
In-Reply-To
<20070826202309.15933.54183.stgit@yoghurt>

If we don't have a value for the remote, just don't write it. Writing None will either write the string "None" or crash StGIT, depending on how exactly the call is done -- and neither is what we want!

Signed-off-by: Karl Hasselström <kha@treskal.com>
---
 stgit/stack.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/stgit/stack.py b/stgit/stack.py
index 030562d..0ce9992 100644
--- a/stgit/stack.py
+++ b/stgit/stack.py
@@ -546,7 +546,8 @@ class Series(PatchSet):
 
     def set_parent(self, remote, localbranch):
         if localbranch:
-            self.__set_parent_remote(remote)
+            if remote:
+                self.__set_parent_remote(remote)
             self.__set_parent_branch(localbranch)
         # We'll enforce this later
 #         else:
Previous: Karl HasselströmNext: Karl Hasselström
Message 3 of 8 in “Miscellaneous fixes”
  1. 0/4 Miscellaneous fixesKarl Hasselström, Aug 26, 2007
  2. 1/4 Don't use test_expect_failure when more than one thing could failKarl Hasselström, Aug 26, 2007
  3. 2/4 Don't write None to the conf fileKarl Hasselström, Aug 26, 2007
  4. 3/4 Replace "git repo-config" with "git config" in help textsKarl Hasselström, Aug 26, 2007
  5. 4/4 Compile regexp just onceKarl Hasselström, Aug 26, 2007
  6. Catalin MarinasAug 29, 2007
  7. Karl HasselströmAug 29, 2007
  8. Catalin MarinasSep 3, 2007

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.