From c401cb48e77459a4ccad76888ad31bef252facc5 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 28 Feb 2006 22:16:01 +0100 Subject: [PATCH] Warn about invalid refs Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- refs.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/refs.c b/refs.c index 826ae7ade..982ebf8ae 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; -- 2.30.2