Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
builtin-apply: use warning() instead of fprintf(stderr, "warning: ")
author
Miklos Vajna
<vmiklos@frugalware.org>
Tue, 24 Mar 2009 01:09:10 +0000
(
02:09
+0100)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 24 Mar 2009 04:02:25 +0000
(21:02 -0700)
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-apply.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
d5c87cb
)
diff --git
a/builtin-apply.c
b/builtin-apply.c
index b52aa20cfaea76f957741d32240a6cb6e161d60e..1926cd80559d3e6d6e917d1ed37c308c3a06d987 100644
(file)
--- a/
builtin-apply.c
+++ b/
builtin-apply.c
@@
-2451,7
+2451,7
@@
static int check_preimage(struct patch *patch, struct cache_entry **ce, struct s
if ((st_mode ^ patch->old_mode) & S_IFMT)
return error("%s: wrong type", old_name);
if (st_mode != patch->old_mode)
if ((st_mode ^ patch->old_mode) & S_IFMT)
return error("%s: wrong type", old_name);
if (st_mode != patch->old_mode)
-
fprintf(stderr, "warning: %s has type %o, expected %o\n
",
+
warning("%s has type %o, expected %o
",
old_name, st_mode, patch->old_mode);
if (!patch->new_mode && !patch->is_delete)
patch->new_mode = st_mode;
old_name, st_mode, patch->old_mode);
if (!patch->new_mode && !patch->is_delete)
patch->new_mode = st_mode;
@@
-2932,8
+2932,7
@@
static int write_out_one_reject(struct patch *patch)
cnt = strlen(patch->new_name);
if (ARRAY_SIZE(namebuf) <= cnt + 5) {
cnt = ARRAY_SIZE(namebuf) - 5;
cnt = strlen(patch->new_name);
if (ARRAY_SIZE(namebuf) <= cnt + 5) {
cnt = ARRAY_SIZE(namebuf) - 5;
- fprintf(stderr,
- "warning: truncating .rej filename to %.*s.rej",
+ warning("truncating .rej filename to %.*s.rej",
cnt - 1, patch->new_name);
}
memcpy(namebuf, patch->new_name, cnt);
cnt - 1, patch->new_name);
}
memcpy(namebuf, patch->new_name, cnt);
@@
-3315,8
+3314,8
@@
int cmd_apply(int argc, const char **argv, const char *unused_prefix)
squelch_whitespace_errors < whitespace_error) {
int squelched =
whitespace_error - squelch_whitespace_errors;
squelch_whitespace_errors < whitespace_error) {
int squelched =
whitespace_error - squelch_whitespace_errors;
-
fprintf(stderr, "warning:
squelched %d "
- "whitespace error%s
\n
",
+
warning("
squelched %d "
+ "whitespace error%s",
squelched,
squelched == 1 ? "" : "s");
}
squelched,
squelched == 1 ? "" : "s");
}
@@
-3326,12
+3325,12
@@
int cmd_apply(int argc, const char **argv, const char *unused_prefix)
whitespace_error == 1 ? "" : "s",
whitespace_error == 1 ? "s" : "");
if (applied_after_fixing_ws && apply)
whitespace_error == 1 ? "" : "s",
whitespace_error == 1 ? "s" : "");
if (applied_after_fixing_ws && apply)
-
fprintf(stderr, "warning:
%d line%s applied after"
- " fixing whitespace errors.
\n
",
+
warning("
%d line%s applied after"
+ " fixing whitespace errors.",
applied_after_fixing_ws,
applied_after_fixing_ws == 1 ? "" : "s");
else if (whitespace_error)
applied_after_fixing_ws,
applied_after_fixing_ws == 1 ? "" : "s");
else if (whitespace_error)
-
fprintf(stderr, "warning: %d line%s add%s whitespace errors.\n
",
+
warning("%d line%s add%s whitespace errors.
",
whitespace_error,
whitespace_error == 1 ? "" : "s",
whitespace_error == 1 ? "s" : "");
whitespace_error,
whitespace_error == 1 ? "" : "s",
whitespace_error == 1 ? "s" : "");