summaryrefslogtreecommitdiff
path: root/sha1_name.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-07-23 17:22:58 -0700
committerJunio C Hamano <gitster@pobox.com>2008-07-23 18:11:04 -0700
commit0c4cd7f4a7aae5527560090aad7ef8dae85f1264 (patch)
treec1278f8d9dfd293c0794a05d2e9c06f75b796ffc /sha1_name.c
parent2ca880fe54660869bc93a2302efced9ab64511d9 (diff)
downloadgit-0c4cd7f4a7aae5527560090aad7ef8dae85f1264.tar.gz
ignore non-existent refs in dwim_log()
f2eba66 (Enable HEAD@{...} and make it independent from the current branch, 2007-02-03) introduced dwim_log() to handle <refname>@{...} syntax, and as part of its processing, it checks if the ref exists by calling refsolve_ref(). It should call it as a reader to make sure the call returns NULL for a nonexistent ref (not as a potential writer in which case it does not return NULL). Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sha1_name.c')
-rw-r--r--sha1_name.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sha1_name.c b/sha1_name.c
index b0b2167578..4fb77f8863 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -273,7 +273,7 @@ int dwim_log(const char *str, int len, unsigned char *sha1, char **log)
const char *ref, *it;
strcpy(path, mkpath(*p, len, str));
- ref = resolve_ref(path, hash, 0, NULL);
+ ref = resolve_ref(path, hash, 1, NULL);
if (!ref)
continue;
if (!stat(git_path("logs/%s", path), &st) &&