1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-02 15:16:11 +02:00

Warn about invalid refs

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Johannes Schindelin 2006-02-28 22:16:01 +01:00 committed by Junio C Hamano
parent 858cbfbabe
commit c401cb48e7

9
refs.c
View File

@ -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;