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

[PATCH] git.__remotes_from_dir() should only return lists

From
PRPavel Roskin <proski@gnu.org>
Date
Sep 5, 2007, 16:57 UTC
Message-ID
<20070905165722.17744.56584.stgit@dv.roinet.com>

If there are no remotes, return empty list, not None. The later doesn't work with builtin set().

This fixes t1001-branch-rename.sh
Signed-off-by: Pavel Roskin <proski@gnu.org>
---
 stgit/git.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/stgit/git.py b/stgit/git.py
index 4b4c626..f847cce 100644
--- a/stgit/git.py
+++ b/stgit/git.py
@@ -953,7 +953,7 @@ def __remotes_from_dir(dir):
     if os.path.exists(d):
         return os.listdir(d)
     else:
-        return None
+        return []
 
 def remotes_list():
     """Return the list of remotes in the repository
Next: Karl Hasselström
Message 1 of 5 in “git.__remotes_from_dir() should only return lists”
  1. git.__remotes_from_dir() should only return listsPavel Roskin, Sep 5, 2007
  2. Karl HasselströmSep 6, 2007
  3. Pavel RoskinSep 6, 2007
  4. Karl HasselströmSep 6, 2007
  5. Karl HasselströmSep 6, 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.