{"thread":{"id":"23647","subject":"git fetch-pack can't fetch refs/stash","startedAt":"2010-04-29T10:24:51Z","lastAt":"2010-04-29T10:24:51Z","messageCount":1,"participants":["Stefan (metze) Metzmacher"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"140669","messageId":"4BD95E73.6040709@samba.org","threadId":"23647","inReplyTo":null,"subject":"git fetch-pack can't fetch refs/stash","fromName":"Stefan (metze) Metzmacher","fromEmail":"metze@samba.org","sentAt":"2010-04-29T10:24:51Z","receivedAt":"2010-04-29T10:24:51Z","isPatch":false,"sender":{"key":"metze@samba.org","avatar":null},"body":"Hi,\n\nI tried to fetch refs/stash from my repository (for backup),\nhowever 'git fetch myremote +refs/stash:refs/remotes/myremote/stash'\njust fails with $? = 1 (without any output).\n\nThat's confusing because 'git ls-remote myremote' shows refs/stash.\n\nAfter some debugging I found the reason for the problem.\n\n'git fetch-pack /path/to/myremote refs/stash' also just returns\n$? = 1.\n\nfilter_refs() skips 'refs/stash', because check_ref_format()\nreturns CHECK_REF_FORMAT_ONELEVEL.\n\nIs that a bug or a feature?\n\nThe easiest fix would be to allow CHECK_REF_FORMAT_ONELEVEL to pass in\nthe same way as CHECK_REF_FORMAT_OK. But I'm not sure if that would\nhave other side effects.\n\nFor now I work around it by doing:\n'mkdir stash.d; cd stash.d; ln -s ../stash .'\nand use\ngit fetch myremote +refs/stash.d/stash:refs/remotes/myremote/stash\n\nmetze\n\n"}]}