Skip to content

Commit bd757c1

Browse files
tfarinagitster
authored andcommitted
Use warning function instead of fprintf(stderr, "Warning: ...").
Signed-off-by: Thiago Farina <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b7fcb58 commit bd757c1

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

bisect.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -813,11 +813,11 @@ static void handle_skipped_merge_base(const unsigned char *mb)
813813
char *bad_hex = sha1_to_hex(current_bad_sha1);
814814
char *good_hex = join_sha1_array_hex(&good_revs, ' ');
815815

816-
fprintf(stderr, "Warning: the merge base between %s and [%s] "
816+
warning("the merge base between %s and [%s] "
817817
"must be skipped.\n"
818818
"So we cannot be sure the first bad commit is "
819819
"between %s and %s.\n"
820-
"We continue anyway.\n",
820+
"We continue anyway.",
821821
bad_hex, good_hex, mb_hex, bad_hex);
822822
free(good_hex);
823823
}

builtin-mv.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
169169
* check both source and destination
170170
*/
171171
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);
175173
bad = NULL;
176174
} else
177175
bad = "Cannot overwrite";

http.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1244,7 +1244,7 @@ int finish_http_object_request(struct http_object_request *freq)
12441244
process_http_object_request(freq);
12451245

12461246
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.");
12481248
} else if (freq->curl_result != CURLE_OK) {
12491249
if (stat(freq->tmpfile, &st) == 0)
12501250
if (st.st_size == 0)

t/t6030-bisect-porcelain.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ test_expect_success 'skipped merge base when good and bad are siblings' '
423423
grep "merge base must be tested" my_bisect_log.txt &&
424424
grep $HASH4 my_bisect_log.txt &&
425425
git bisect skip > my_bisect_log.txt 2>&1 &&
426-
grep "Warning" my_bisect_log.txt &&
426+
grep "warning" my_bisect_log.txt &&
427427
grep $SIDE_HASH6 my_bisect_log.txt &&
428428
git bisect reset
429429
'

0 commit comments

Comments
 (0)