summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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 */