{"thread":{"id":"45163","subject":"libgit2::git_describe_workdir() fails with depth-cloned + detached head","startedAt":"2017-02-17T15:39:51Z","lastAt":"2017-02-17T15:39:51Z","messageCount":1,"participants":["Lukas Lueg"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"311896","messageId":"CAJF-kYmrqgTtj=TMdzAaru-XKVUyQqXLTDY6Cytc-3VQEz0LTw@mail.gmail.com","threadId":"45163","inReplyTo":null,"subject":"libgit2::git_describe_workdir() fails with depth-cloned + detached head","fromName":"Lukas Lueg","fromEmail":"lukas.lueg@gmail.com","sentAt":"2017-02-17T15:39:24Z","receivedAt":"2017-02-17T15:39:51Z","isPatch":false,"sender":{"key":"lukas.lueg@gmail.com","avatar":null},"body":"Hi,\n\nI have a build on Travis failing with a weird error that happens while\ntrying to get a description from a repo. One of the integration tests\nthat are executed on Travis executes libgit2::git_describe_workdir()\non it's own repo and fails with code: -3, klass: 9, message: \"object\nnot found - no match for id\n(77f95f14776deb7e120a2a26f7b56abf2903bc62)\".\n\nThe id 77f95f1 from the error message refers to a commit that is of no\nparticular interest and actually weeks behind; I never asked for it.\n\nI was finally able to reproduce the problem by very carefully\nfollowing how Travis clones the repo:\n\ngit clone --depth=50 https://... repo_root\ncd repo_root\ngit fetch origin +refs/pull/414/merge:\ngit checkout -qf FETCH_HEAD\n\nIf and only if the repo is cloned recursively, the call to\nlibgit2::git_describe_workdir() results in this error, always\nreferring to 77f95f1. If the repo is cloned without '--depth 50', no\nerror occurs. The repo does not even have submodules.\n\nMy local git client does the right thing and get's the latest commit\noid without problems.\n\nAny idea what's going on here?\n\nBest regards\nLukas\n"}]}