Skip to content

Commit

Permalink
refs: use warning() instead of fprintf(stderr, "warning: ")
Browse files Browse the repository at this point in the history
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Miklos Vajna authored and Junio C Hamano committed Mar 24, 2009
1 parent 5620e77 commit edbc25c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions refs.c
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@ int delete_ref(const char *refname, const unsigned char *sha1, int delopt)

err = unlink(git_path("logs/%s", lock->ref_name));
if (err && errno != ENOENT)
fprintf(stderr, "warning: unlink(%s) failed: %s",
warning("unlink(%s) failed: %s",
git_path("logs/%s", lock->ref_name), strerror(errno));
invalidate_cached_refs();
unlock_ref(lock);
Expand Down Expand Up @@ -1438,8 +1438,7 @@ int read_ref_at(const char *ref, unsigned long at_time, int cnt, unsigned char *
if (get_sha1_hex(rec + 41, sha1))
die("Log %s is corrupt.", logfile);
if (hashcmp(logged_sha1, sha1)) {
fprintf(stderr,
"warning: Log %s has gap after %s.\n",
warning("Log %s has gap after %s.",
logfile, show_date(date, tz, DATE_RFC2822));
}
}
Expand All @@ -1451,8 +1450,7 @@ int read_ref_at(const char *ref, unsigned long at_time, int cnt, unsigned char *
if (get_sha1_hex(rec + 41, logged_sha1))
die("Log %s is corrupt.", logfile);
if (hashcmp(logged_sha1, sha1)) {
fprintf(stderr,
"warning: Log %s unexpectedly ended on %s.\n",
warning("Log %s unexpectedly ended on %s.",
logfile, show_date(date, tz, DATE_RFC2822));
}
}
Expand Down

0 comments on commit edbc25c

Please sign in to comment.