Skip to content

Commit 671e629

Browse files
committed
Merge branch 'ab/replace-graft-with-replace-advice'
The advice message to tell the user to migrate an existing graft file to the replace system when a graft file was read was shown even when "git replace --convert-graft-file" command, which is the way the message suggests to use, was running, which made little sense. * ab/replace-graft-with-replace-advice: advice: don't pointlessly suggest --convert-graft-file
2 parents 881d72e + 8821e90 commit 671e629

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

builtin/replace.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,7 @@ static int convert_graft_file(int force)
495495
if (!fp)
496496
return -1;
497497

498+
advice_graft_file_deprecated = 0;
498499
while (strbuf_getline(&buf, fp) != EOF) {
499500
if (*buf.buf == '#')
500501
continue;

t/t6050-replace.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,10 @@ test_expect_success '--convert-graft-file' '
461461
printf "%s\n%s %s\n\n# comment\n%s\n" \
462462
$(git rev-parse HEAD^^ HEAD^ HEAD^^ HEAD^2) \
463463
>.git/info/grafts &&
464-
git replace --convert-graft-file &&
464+
git status 2>stderr &&
465+
test_i18ngrep "hint:.*grafts is deprecated" stderr &&
466+
git replace --convert-graft-file 2>stderr &&
467+
test_i18ngrep ! "hint:.*grafts is deprecated" stderr &&
465468
test_path_is_missing .git/info/grafts &&
466469
467470
: verify that the history is now "grafted" &&

0 commit comments

Comments
 (0)