From 98330c2962a26759c110ff91bf347c0652a3df23 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Fri, 2 Feb 2007 17:18:40 +0000 Subject: [PATCH] Allow .git/branches and .git/remotes to be missing 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 --- stgit/git.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/stgit/git.py b/stgit/git.py index 022d607..3d84e97 100644 --- a/stgit/git.py +++ b/stgit/git.py @@ -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 -- 2.11.0