From: Johannes Schindelin Date: Tue, 28 Feb 2006 21:16:01 +0000 (+0100) Subject: Warn about invalid refs X-Git-Tag: v1.3.0-rc1~100^2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=c401cb48e77459a4ccad76888ad31bef252facc5;p=git.git Warn about invalid refs Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- diff --git a/refs.c b/refs.c index 826ae7ad..982ebf8a 100644 --- a/refs.c +++ b/refs.c @@ -151,10 +151,15 @@ static int do_for_each_ref(const char *base, int (*fn)(const char *path, const u break; continue; } - if (read_ref(git_path("%s", path), sha1) < 0) + if (read_ref(git_path("%s", path), sha1) < 0) { + fprintf(stderr, "%s points nowhere!", path); continue; - if (!has_sha1_file(sha1)) + } + if (!has_sha1_file(sha1)) { + fprintf(stderr, "%s does not point to a valid " + "commit object!", path); continue; + } retval = fn(path, sha1); if (retval) break;