@matheusbsbs / matheus-bagliano / commits / bd757c1859
Fork 0

Use warning function instead of fprintf(stderr, "Warning: ...").

Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Thiago Farina committed Jan 3, 2010 at 11:20 UTC bd757c18597789d4f01cbd2ffc7c1f55e90cfcd0
4 files changed +5 -7
bisect.c
+2 -2
@@ -813,11 +813,11 @@ static void handle_skipped_merge_base(const unsigned char *mb)
813 char *bad_hex = sha1_to_hex(current_bad_sha1);
814 char *good_hex = join_sha1_array_hex(&good_revs, ' ');
815
816 - fprintf(stderr, "Warning: the merge base between %s and [%s] "
816 + warning("the merge base between %s and [%s] "
817 "must be skipped.\n"
818 "So we cannot be sure the first bad commit is "
819 "between %s and %s.\n"
820 - "We continue anyway.\n",
820 + "We continue anyway.",
821 bad_hex, good_hex, mb_hex, bad_hex);
822 free(good_hex);
823 }
builtin-mv.c
+1 -3
@@ -169,9 +169,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
169 * check both source and destination
170 */
171 if (S_ISREG(st.st_mode) || S_ISLNK(st.st_mode)) {
172 - fprintf(stderr, "Warning: %s;"
173 - " will overwrite!\n",
174 - bad);
172 + warning("%s; will overwrite!", bad);
173 bad = NULL;
174 } else
175 bad = "Cannot overwrite";
http.c
+1 -1
@@ -1244,7 +1244,7 @@ int finish_http_object_request(struct http_object_request *freq)
1244 process_http_object_request(freq);
1245
1246 if (freq->http_code == 416) {
1247 - fprintf(stderr, "Warning: requested range invalid; we may already have all the data.\n");
1247 + warning("requested range invalid; we may already have all the data.");
1248 } else if (freq->curl_result != CURLE_OK) {
1249 if (stat(freq->tmpfile, &st) == 0)
1250 if (st.st_size == 0)
t/t6030-bisect-porcelain.sh
+1 -1
@@ -423,7 +423,7 @@ test_expect_success 'skipped merge base when good and bad are siblings' '
423 grep "merge base must be tested" my_bisect_log.txt &&
424 grep $HASH4 my_bisect_log.txt &&
425 git bisect skip > my_bisect_log.txt 2>&1 &&
426 - grep "Warning" my_bisect_log.txt &&
426 + grep "warning" my_bisect_log.txt &&
427 grep $SIDE_HASH6 my_bisect_log.txt &&
428 git bisect reset
429 '