Title: Fetching a remote without a configured refspec raises ValueError · Issue #296 · gitpython-developers/GitPython · GitHub
Open Graph Title: Fetching a remote without a configured refspec raises ValueError · Issue #296 · gitpython-developers/GitPython
X Title: Fetching a remote without a configured refspec raises ValueError · Issue #296 · gitpython-developers/GitPython
Description: I found this easiest to reproduce by creating a bare clone of another repository. Set up like this: ben@earwig:~/test $ git init foo Initialized empty Git repository in /Users/ben/test/foo/.git/ ben@earwig:~/test $ cd foo ben@earwig:~/te...
Open Graph Description: I found this easiest to reproduce by creating a bare clone of another repository. Set up like this: ben@earwig:~/test $ git init foo Initialized empty Git repository in /Users/ben/test/foo/.git/ be...
X Description: I found this easiest to reproduce by creating a bare clone of another repository. Set up like this: ben@earwig:~/test $ git init foo Initialized empty Git repository in /Users/ben/test/foo/.git/ be...
Opengraph URL: https://github.com/gitpython-developers/GitPython/issues/296
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Fetching a remote without a configured refspec raises ValueError","articleBody":"I found this easiest to reproduce by creating a bare clone of another repository.\n\nSet up like this:\n\n```\nben@earwig:~/test $ git init foo\nInitialized empty Git repository in /Users/ben/test/foo/.git/\nben@earwig:~/test $ cd foo\nben@earwig:~/test/foo [master] $ echo \"test\" \u003e test \u0026\u0026 git add test \u0026\u0026 git commit -m \"test\"\n[master (root-commit) 269c498] test\n 1 file changed, 1 insertion(+)\n create mode 100644 test\nben@earwig:~/test/foo [master] $ cd ..\nben@earwig:~/test $ git clone --bare foo bar\nCloning into bare repository 'bar'...\ndone.\n```\n\nNote the structure of the `config` file and that an ordinary `git fetch origin` works.\n\n```\nben@earwig:~/test $ cd bar\nben@earwig:~/test/bar [BARE:master] $ cat config\n[core]\n repositoryformatversion = 0\n filemode = true\n bare = true\n ignorecase = true\n precomposeunicode = true\n[remote \"origin\"]\n url = /Users/ben/test/foo\nben@earwig:~/test/bar [BARE:master] $ git fetch origin\nFrom /Users/ben/test/foo\n * branch HEAD -\u003e FETCH_HEAD\n```\n\nNow, here's the bug:\n\n```\nben@earwig:~/test/bar [BARE:master] $ python\nPython 2.7.10 (default, May 29 2015, 21:05:23)\n[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\u003e\u003e\u003e import git\n\u003e\u003e\u003e git.Repo().remotes.origin.fetch()\nTraceback (most recent call last):\n File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\n File \"/usr/local/lib/python2.7/site-packages/git/remote.py\", line 651, in fetch\n res = self._get_fetch_info_from_stderr(proc, progress or RemoteProgress())\n File \"/usr/local/lib/python2.7/site-packages/git/remote.py\", line 588, in _get_fetch_info_from_stderr\n for err_line, fetch_line in zip(fetch_info_lines, fetch_head_info))\n File \"/usr/local/lib/python2.7/site-packages/git/remote.py\", line 588, in \u003cgenexpr\u003e\n for err_line, fetch_line in zip(fetch_info_lines, fetch_head_info))\n File \"/usr/local/lib/python2.7/site-packages/git/remote.py\", line 249, in _from_line\n raise ValueError(\"Failed to parse FETCH_HEAD line: %r\" % fetch_line)\nValueError: Failed to parse FETCH_HEAD line: u'269c498e56feb93e408ed4558c8138d750de8893\\t\\t/Users/ben/test/foo\\n'\n\u003e\u003e\u003e\n```\n\nIf I add a valid refspec to the config, it works:\n\n```\nben@earwig:~/test/bar [BARE:master] $ git config --add remote.origin.fetch +refs/heads/*:refs/heads/*\nben@earwig:~/test/bar [BARE:master] $ python\nPython 2.7.10 (default, May 29 2015, 21:05:23)\n[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\u003e\u003e\u003e import git\n\u003e\u003e\u003e git.Repo().remotes.origin.fetch()\n[\u003cgit.remote.FetchInfo object at 0x11094a0a8\u003e]\n\u003e\u003e\u003e\n```\n","author":{"url":"https://github.com/earwig","@type":"Person","name":"earwig"},"datePublished":"2015-06-06T00:33:41.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/296/GitPython/issues/296"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:07df04be-cea5-3bc9-4786-c3c04378a8e1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8E20:A457C:CEC54F:11425D7:69699ACE |
| html-safe-nonce | fab3c46545fc5435ebf3f6ff68eed783528c34bc7ec0f708e93b1850b678e1e6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RTIwOkE0NTdDOkNFQzU0RjoxMTQyNUQ3OjY5Njk5QUNFIiwidmlzaXRvcl9pZCI6IjUyMzUyNjMzNzk3ODAyNDYyMjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 35628a4cc24e6ab1a24ec20adfeb72618b118e384cbf1ca18fbdada16e3ba24c |
| hovercard-subject-tag | issue:85664381 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/gitpython-developers/GitPython/296/issue_layout |
| twitter:image | https://opengraph.githubassets.com/52c8811a354cc79cb1e08d3a05df33d4148eb37c14b2249211042378c32937ec/gitpython-developers/GitPython/issues/296 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/52c8811a354cc79cb1e08d3a05df33d4148eb37c14b2249211042378c32937ec/gitpython-developers/GitPython/issues/296 |
| og:image:alt | I found this easiest to reproduce by creating a bare clone of another repository. Set up like this: ben@earwig:~/test $ git init foo Initialized empty Git repository in /Users/ben/test/foo/.git/ be... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | earwig |
| hostname | github.com |
| expected-hostname | github.com |
| None | 24c4c97a2d520cb286b35e1a4c22d7a4df3c26a2fa28dd7cdf0e65db327b4de7 |
| turbo-cache-control | no-preview |
| go-import | github.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git |
| octolytics-dimension-user_id | 503709 |
| octolytics-dimension-user_login | gitpython-developers |
| octolytics-dimension-repository_id | 1126087 |
| octolytics-dimension-repository_nwo | gitpython-developers/GitPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1126087 |
| octolytics-dimension-repository_network_root_nwo | gitpython-developers/GitPython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 124667f43168afb6c9c03b7c02eb5b1d2e1be3d9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width