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

[PATCH] Allow .git/branches and .git/remotes to be missing

From
PRPavel Roskin <proski@gnu.org>
Date
Feb 2, 2007, 00:33 UTC
Message-ID
<1170376385.28867.13.camel@dv>
From: Pavel Roskin <proski@gnu.org>

Both directories are now obsoleted by .git/config file. This fixes "make test" in StGIT with git 1.5.0-rc3.

Signed-off-by: Pavel Roskin <proski@gnu.org>
---
 stgit/git.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/stgit/git.py b/stgit/git.py
index c7cc6a7..553a6bf 100644
--- a/stgit/git.py
+++ b/stgit/git.py
@@ -908,7 +908,11 @@ def __remotes_from_config():
     return config.sections_matching(r'remote\.(.*)\.url')
 
 def __remotes_from_dir(dir):
-    return os.listdir(os.path.join(basedir.get(), dir))
+    d = os.path.join(basedir.get(), dir)
+    if os.path.exists(d):
+        return os.listdir(d)
+    else:
+        return None
 
 def remotes_list():
     """Return the list of remotes in the repository
-- 
Regards,
Pavel Roskin
Message 1 of 1 in “Allow .git/branches and .git/remotes to be missing”
  1. Allow .git/branches and .git/remotes to be missingPavel Roskin, Feb 2, 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.