{"thread":{"id":"6631","subject":"[PATCH] Be tolerant to repos without .git/remotes/ or .git/branches/.","startedAt":"2007-02-02T23:00:08Z","lastAt":"2007-02-02T23:03:22Z","messageCount":2,"participants":["Yann Dirson","Catalin Marinas"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"33418","messageId":"20070202225900.30628.17382.stgit@gandelf.nowhere.earth","threadId":"6631","inReplyTo":null,"subject":"[PATCH] Be tolerant to repos without .git/remotes/ or .git/branches/.","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2007-02-02T23:00:08Z","receivedAt":"2007-02-02T23:00:08Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"\n__remotes_from_dir() was not robust against non-existent dirs.\nThis a Git 1.5 compat issue, since repos do not have .git/remotes any\nmore.\n\nSigned-off-by: Yann Dirson <ydirson@altern.org>\n---\n\nThis problem prevented me from seeing the t1200 regression you\nreported, but once this one is fixed I do hit a problem there.\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 022d607..069833d 100644\n--- a/stgit/git.py\n+++ b/stgit/git.py\n@@ -904,7 +904,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+    absdir=os.path.join(basedir.get(), dir)\n+    if os.path.isdir(absdir):\n+        return os.listdir(absdir)\n+    else:\n+        return []\n \n def remotes_list():\n     \"\"\"Return the list of remotes in the repository\n"},{"id":"33420","messageId":"b0943d9e0702021503v6ae3851agdf6158eb4a386af8@mail.gmail.com","threadId":"6631","inReplyTo":"20070202225900.30628.17382.stgit@gandelf.nowhere.earth","subject":"Re: [PATCH] Be tolerant to repos without .git/remotes/ or .git/branches/.","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2007-02-02T23:03:22Z","receivedAt":"2007-02-02T23:03:22Z","isPatch":true,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 02/02/07, Yann Dirson <ydirson@altern.org> wrote:\n> __remotes_from_dir() was not robust against non-existent dirs.\n> This a Git 1.5 compat issue, since repos do not have .git/remotes any\n> more.\n\nI already included the same patch from Pavel Roskin.\n\n-- \nCatalin\n"}]}