Skip to content

Commit

Permalink
Merge branch 'js/refs'
Browse files Browse the repository at this point in the history
* js/refs:
  Warn about invalid refs
  • Loading branch information
Junio C Hamano committed Mar 2, 2006
2 parents 0093154 + c401cb4 commit b6b626f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions refs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b6b626f

Please sign in to comment.