chiark / gitweb /
Allow .git/branches and .git/remotes to be missing
authorPavel Roskin <proski@gnu.org>
Fri, 2 Feb 2007 17:18:40 +0000 (17:18 +0000)
committerCatalin Marinas <catalin.marinas@gmail.com>
Fri, 2 Feb 2007 22:58:20 +0000 (22:58 +0000)
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

index 022d607377369967ff154c5302a2439a0c4f5f54..3d84e97a4bbb05cf492e572cece4ccaa14bff317 100644 (file)
@@ -904,7 +904,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