summaryrefslogtreecommitdiff
path: root/src/revparse.c
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2012-06-28 11:09:16 +0200
committernulltoken <emeric.fermas@gmail.com>2012-06-28 19:12:41 +0200
commit0d23c62c480d155b8ba446ca2ec536758a567bcc (patch)
tree703f70891390fe88be0fbce59862782a519965fb /src/revparse.c
parent5b68ba7e158367c9dc613754c50cad640a63fd52 (diff)
downloadlibgit2-0d23c62c480d155b8ba446ca2ec536758a567bcc.tar.gz
revparse: handle specs with caret and colon
Diffstat (limited to 'src/revparse.c')
-rw-r--r--src/revparse.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/revparse.c b/src/revparse.c
index 1b466cde0..dd3886e2d 100644
--- a/src/revparse.c
+++ b/src/revparse.c
@@ -732,6 +732,10 @@ int git_revparse_single(git_object **out, git_repository *repo, const char *spec
if (retcode < 0) {
next_state = REVPARSE_STATE_DONE;
}
+ } else if (*spec_cur == ':') {
+ retcode = handle_caret_syntax(&next_obj, repo, cur_obj, git_buf_cstr(&stepbuffer));
+ git_buf_clear(&stepbuffer);
+ next_state = !retcode ? REVPARSE_STATE_COLON : REVPARSE_STATE_DONE;
} else {
git_buf_putc(&stepbuffer, *spec_cur);
}