summaryrefslogtreecommitdiff
path: root/src/revparse.c
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2012-09-21 10:28:20 +0200
committernulltoken <emeric.fermas@gmail.com>2012-10-07 12:04:19 +0200
commit74a24005146d0f908b2660db5f7e198adad4ab64 (patch)
tree71fb7eada7a75190073a00be84d27226ef6e6f4a /src/revparse.c
parentacd1700630ea1159a55dc5e8cee12e4a725afe18 (diff)
downloadlibgit2-74a24005146d0f908b2660db5f7e198adad4ab64.tar.gz
refs: use constants for well-known names
Diffstat (limited to 'src/revparse.c')
-rw-r--r--src/revparse.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/revparse.c b/src/revparse.c
index 5e2db99cd..191f6374c 100644
--- a/src/revparse.c
+++ b/src/revparse.c
@@ -28,11 +28,11 @@ static int disambiguate_refname(git_reference **out, git_repository *repo, const
static const char* formatters[] = {
"%s",
- "refs/%s",
- "refs/tags/%s",
- "refs/heads/%s",
- "refs/remotes/%s",
- "refs/remotes/%s/HEAD",
+ GIT_REFS_DIR "%s",
+ GIT_REFS_TAGS_DIR "%s",
+ GIT_REFS_HEADS_DIR "%s",
+ GIT_REFS_REMOTES_DIR "%s",
+ GIT_REFS_REMOTES_DIR "%s/" GIT_HEAD_FILE,
NULL
};
@@ -520,7 +520,7 @@ static int handle_grep_syntax(git_object **out, git_repository *repo, const git_
if (spec_oid == NULL) {
// TODO: @carlosmn: The glob should be refs/* but this makes git_revwalk_next() fails
- if (git_revwalk_push_glob(walk, "refs/heads/*") < 0)
+ if (git_revwalk_push_glob(walk, GIT_REFS_HEADS_DIR "*") < 0)
goto cleanup;
} else if (git_revwalk_push(walk, spec_oid) < 0)
goto cleanup;