提交 c401cb48 编写于 作者: J Johannes Schindelin 提交者: Junio C Hamano

Warn about invalid refs

Signed-off-by: NJohannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 858cbfba
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册