From: Linus Torvalds Date: Tue, 5 Jul 2005 22:45:00 +0000 (-0700) Subject: Fix silly thinko in "head_ref()" X-Git-Tag: v0.99~67 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=2f34ba32dde0131ab280f8ca902f04e39af7dcc0;p=git.git Fix silly thinko in "head_ref()" It did a "for_each_ref()" in addition to the HEAD case, which was a left-over from an early broken test. --- diff --git a/refs.c b/refs.c index 6ca04d3b..09c9f904 100644 --- a/refs.c +++ b/refs.c @@ -73,8 +73,8 @@ int head_ref(int (*fn)(const char *path, const unsigned char *sha1)) unsigned char sha1[20]; const char *headpath = git_path("HEAD"); if (!read_ref(headpath, sha1)) - fn(headpath, sha1); - return do_for_each_ref(get_refs_directory(), fn); + return fn(headpath, sha1); + return 0; } int for_each_ref(int (*fn)(const char *path, const unsigned char *sha1))