Skip to contentSkip to conversation

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

PATCH New Pavel Roskin 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Allow .git/branches and .git/remotes to be missing

From: Pavel Roskin <[email protected]>

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

---

 stgit/git.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
stgit/git.py +5 -1
index c7cc6a7..553a6bf 100644
@@ -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
Signature · 2 lines
Regards,
Pavel Roskin