@matheusbsbs / matheus-bagliano / commits / 0c4cd7f4a7
Fork 0

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>

Junio C Hamano committed Jul 23, 2008 at 17:22 UTC 0c4cd7f4a7aae5527560090aad7ef8dae85f1264
1 file changed +1 -1
sha1_name.c
+1 -1
@@ -273,7 +273,7 @@ int dwim_log(const char *str, int len, unsigned char *sha1, char **log)
273 const char *ref, *it;
274
275 strcpy(path, mkpath(*p, len, str));
276 - ref = resolve_ref(path, hash, 0, NULL);
276 + ref = resolve_ref(path, hash, 1, NULL);
277 if (!ref)
278 continue;
279 if (!stat(git_path("logs/%s", path), &st) &&