Commit 46c2ead0 by Ben Straub

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

parent ec6a632a
...@@ -56,9 +56,9 @@ static int revparse_lookup_object(git_object **out, git_repository *repo, const ...@@ -56,9 +56,9 @@ static int revparse_lookup_object(git_object **out, git_repository *repo, const
/* "git describe" output; snip everything before/including "-g" */ /* "git describe" output; snip everything before/including "-g" */
substr = strstr(spec, "-g"); substr = strstr(spec, "-g");
if (substr) { if (substr &&
spec = substr + 2; !revparse_lookup_object(out, repo, substr+2)) {
speclen = strlen(spec); return 0;
} }
/* SHA or prefix */ /* SHA or prefix */
......
...@@ -66,6 +66,7 @@ void test_refs_revparse__partial_refs(void) ...@@ -66,6 +66,7 @@ void test_refs_revparse__partial_refs(void)
void test_refs_revparse__describe_output(void) void test_refs_revparse__describe_output(void)
{ {
test_object("blah-7-gc47800c", "c47800c7266a2be04c571c04d5a6614691ea99bd"); test_object("blah-7-gc47800c", "c47800c7266a2be04c571c04d5a6614691ea99bd");
test_object("not-good", "a65fedf39aefe402d3bb6e24df4d4f5fe4547750");
} }
void test_refs_revparse__nth_parent(void) void test_refs_revparse__nth_parent(void)
......
a65fedf39aefe402d3bb6e24df4d4f5fe4547750
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment