Now properly handling branches with "-g" in their names.

This commit is contained in:
Ben Straub 2012-05-10 13:39:34 -07:00
parent ec6a632a1b
commit 46c2ead05d
3 changed files with 4 additions and 3 deletions

View File

@ -56,9 +56,9 @@ static int revparse_lookup_object(git_object **out, git_repository *repo, const
/* "git describe" output; snip everything before/including "-g" */
substr = strstr(spec, "-g");
if (substr) {
spec = substr + 2;
speclen = strlen(spec);
if (substr &&
!revparse_lookup_object(out, repo, substr+2)) {
return 0;
}
/* SHA or prefix */

View File

@ -66,6 +66,7 @@ void test_refs_revparse__partial_refs(void)
void test_refs_revparse__describe_output(void)
{
test_object("blah-7-gc47800c", "c47800c7266a2be04c571c04d5a6614691ea99bd");
test_object("not-good", "a65fedf39aefe402d3bb6e24df4d4f5fe4547750");
}
void test_refs_revparse__nth_parent(void)

Binary file not shown.