summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2006-02-28 21:16:01 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-03-01 09:15:12 (GMT)
commitc401cb48e77459a4ccad76888ad31bef252facc5 (patch)
tree44a34acdd16f7a432187565d6ffb46210307196c /refs.c
parent858cbfbabe4ede5f5eba32041eb7448319e53e2a (diff)
downloadgit-c401cb48e77459a4ccad76888ad31bef252facc5.zip
git-c401cb48e77459a4ccad76888ad31bef252facc5.tar.gz
git-c401cb48e77459a4ccad76888ad31bef252facc5.tar.bz2
Warn about invalid refs
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/refs.c b/refs.c
index 826ae7a..982ebf8 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;