From: Pavel Roskin Date: Fri, 2 Feb 2007 17:18:40 +0000 (+0000) Subject: Allow .git/branches and .git/remotes to be missing X-Git-Tag: v0.14.3~352 X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/commitdiff_plain/98330c2962a26759c110ff91bf347c0652a3df23 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 --- 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