threads / patch / 6620

patchAllow .git/branches and .git/remotes to be missing

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

## tl;dr

One message between Feb 2, 2007 and Feb 2, 2007. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Pavel Roskin· Feb 2, 2007, 00:33 UTC · lore
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(-)
Show changes to stgit/git.py +5 −1
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

← back to recent threads