git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Allow .git/branches and .git/remotes to be missing
@ 2007-02-02  0:33 Pavel Roskin
  0 siblings, 0 replies; only message in thread
From: Pavel Roskin @ 2007-02-02  0:33 UTC (permalink / raw)
  To: Catalin Marinas; +Cc: git

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-02-02  0:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-02  0:33 [PATCH] Allow .git/branches and .git/remotes to be missing Pavel Roskin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).