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

Warn about invalid refs

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>

Johannes Schindelin committed Feb 28, 2006 at 22:16 UTC c401cb48e77459a4ccad76888ad31bef252facc5
1 file changed +7 -2
refs.c
+7 -2
@@ -151,10 +151,15 @@ static int do_for_each_ref(const char *base, int (*fn)(const char *path, const u
151 break;
152 continue;
153 }
154 - if (read_ref(git_path("%s", path), sha1) < 0)
154 + if (read_ref(git_path("%s", path), sha1) < 0) {
155 + fprintf(stderr, "%s points nowhere!", path);
156 continue;
156 - if (!has_sha1_file(sha1))
157 + }
158 + if (!has_sha1_file(sha1)) {
159 + fprintf(stderr, "%s does not point to a valid "
160 + "commit object!", path);
161 continue;
162 + }
163 retval = fn(path, sha1);
164 if (retval)
165 break;