summaryrefslogtreecommitdiff
path: root/src/revparse.c
diff options
context:
space:
mode:
authorBen Straub <bstraub@github.com>2012-05-10 13:39:34 -0700
committerBen Straub <bstraub@github.com>2012-05-11 11:35:50 -0700
commit46c2ead05d289b4ed1ad96c63b75a228f02dd74c (patch)
treed5873ec9ebb8ce1ff41a6ac4f8e103de3944ec5d /src/revparse.c
parentec6a632a1bdc5e14c14964005946f35ad61c0259 (diff)
downloadlibgit2-46c2ead05d289b4ed1ad96c63b75a228f02dd74c.tar.gz
Now properly handling branches with "-g" in their names.
Diffstat (limited to 'src/revparse.c')
-rw-r--r--src/revparse.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/revparse.c b/src/revparse.c
index 4c03fdf38..c22bd98d8 100644
--- a/src/revparse.c
+++ b/src/revparse.c
@@ -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 */