{"thread":{"id":"6620","subject":"[PATCH] Allow .git/branches and .git/remotes to be missing","startedAt":"2007-02-02T00:33:05Z","lastAt":"2007-02-02T00:33:05Z","messageCount":1,"participants":["Pavel Roskin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"33321","messageId":"1170376385.28867.13.camel@dv","threadId":"6620","inReplyTo":null,"subject":"[PATCH] Allow .git/branches and .git/remotes to be missing","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2007-02-02T00:33:05Z","receivedAt":"2007-02-02T00:33:05Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"From: Pavel Roskin <proski@gnu.org>\n\nBoth directories are now obsoleted by .git/config file.  This fixes\n\"make test\" in StGIT with git 1.5.0-rc3.\n\nSigned-off-by: Pavel Roskin <proski@gnu.org>\n---\n\n stgit/git.py |    6 +++++-\n 1 files changed, 5 insertions(+), 1 deletions(-)\n\ndiff --git a/stgit/git.py b/stgit/git.py\nindex c7cc6a7..553a6bf 100644\n--- a/stgit/git.py\n+++ b/stgit/git.py\n@@ -908,7 +908,11 @@ def __remotes_from_config():\n     return config.sections_matching(r'remote\\.(.*)\\.url')\n \n def __remotes_from_dir(dir):\n-    return os.listdir(os.path.join(basedir.get(), dir))\n+    d = os.path.join(basedir.get(), dir)\n+    if os.path.exists(d):\n+        return os.listdir(d)\n+    else:\n+        return None\n \n def remotes_list():\n     \"\"\"Return the list of remotes in the repository\n\n-- \nRegards,\nPavel Roskin\n"}]}