Use warning function instead of fprintf(stderr, "Warning: ...").
authorThiago Farina <tfransosi@gmail.com>
Sun, 3 Jan 2010 16:20:30 +0000 (11:20 -0500)
committerJunio C Hamano <gitster@pobox.com>
Mon, 4 Jan 2010 00:17:03 +0000 (16:17 -0800)
Signed-off-by: Thiago Farina <tfransosi@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
bisect.c
builtin-mv.c
http.c
t/t6030-bisect-porcelain.sh

index dc18db8af96b093d7cb16eb88d3f738f98dc30f6..f1a1f84aa04102378ffe37b8e5b617a6fffeb2fa 100644 (file)
--- a/bisect.c
+++ b/bisect.c
@@ -813,11 +813,11 @@ static void handle_skipped_merge_base(const unsigned char *mb)
        char *bad_hex = sha1_to_hex(current_bad_sha1);
        char *good_hex = join_sha1_array_hex(&good_revs, ' ');
 
-       fprintf(stderr, "Warning: the merge base between %s and [%s] "
+       warning("the merge base between %s and [%s] "
                "must be skipped.\n"
                "So we cannot be sure the first bad commit is "
                "between %s and %s.\n"
-               "We continue anyway.\n",
+               "We continue anyway.",
                bad_hex, good_hex, mb_hex, bad_hex);
        free(good_hex);
 }
index f633d81424f5e41cb85ac660dbdc9f4913852673..82471869a0b677202fb5585e2fca880d16478af8 100644 (file)
@@ -169,9 +169,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
                                 * check both source and destination
                                 */
                                if (S_ISREG(st.st_mode) || S_ISLNK(st.st_mode)) {
-                                       fprintf(stderr, "Warning: %s;"
-                                                       " will overwrite!\n",
-                                                       bad);
+                                       warning("%s; will overwrite!", bad);
                                        bad = NULL;
                                } else
                                        bad = "Cannot overwrite";
diff --git a/http.c b/http.c
index ed6414a2aaa4e0f6cf7672a089f49060aad62bfb..455732fb243180bb1101a6b5135f332f9f13fd7a 100644 (file)
--- a/http.c
+++ b/http.c
@@ -1244,7 +1244,7 @@ int finish_http_object_request(struct http_object_request *freq)
        process_http_object_request(freq);
 
        if (freq->http_code == 416) {
-               fprintf(stderr, "Warning: requested range invalid; we may already have all the data.\n");
+               warning("requested range invalid; we may already have all the data.");
        } else if (freq->curl_result != CURLE_OK) {
                if (stat(freq->tmpfile, &st) == 0)
                        if (st.st_size == 0)
index def397c53a76dead449710eaca6333c2e1fb36aa..c51865fdbc0a6fd98cca4a4accd35b302e5fd739 100755 (executable)
@@ -423,7 +423,7 @@ test_expect_success 'skipped merge base when good and bad are siblings' '
        grep "merge base must be tested" my_bisect_log.txt &&
        grep $HASH4 my_bisect_log.txt &&
        git bisect skip > my_bisect_log.txt 2>&1 &&
-       grep "Warning" my_bisect_log.txt &&
+       grep "warning" my_bisect_log.txt &&
        grep $SIDE_HASH6 my_bisect_log.txt &&
        git bisect reset
 '