@@ -118,10 +118,10 @@ do
done
test_expect_success 'show advice that grafts are deprecated' '
- git show HEAD 2>err &&
+ GIT_ADVICE=1 git show HEAD 2>err &&
test_grep "git replace" err &&
test_config advice.graftFileDeprecated false &&
- git show HEAD 2>err &&
+ GIT_ADVICE=1 git show HEAD 2>err &&
test_grep ! "git replace" err
'
@@ -489,9 +489,9 @@ test_expect_success '--convert-graft-file' '
printf "%s\n%s %s\n\n# comment\n%s\n" \
$(git rev-parse HEAD^^ HEAD^ HEAD^^ HEAD^2) \
>.git/info/grafts &&
- git status 2>stderr &&
+ GIT_ADVICE=1 git status 2>stderr &&
test_grep "hint:.*grafts is deprecated" stderr &&
- git replace --convert-graft-file 2>stderr &&
+ GIT_ADVICE=1 git replace --convert-graft-file 2>stderr &&
test_grep ! "hint:.*grafts is deprecated" stderr &&
test_path_is_missing .git/info/grafts &&
@@ -502,7 +502,7 @@ test_expect_success '--convert-graft-file' '
: create invalid graft file and verify that it is not deleted &&
test_when_finished "rm -f .git/info/grafts" &&
echo $EMPTY_BLOB $EMPTY_TREE >.git/info/grafts &&
- test_must_fail git replace --convert-graft-file 2>err &&
+ test_env GIT_ADVICE=1 test_must_fail git replace --convert-graft-file 2>err &&
test_grep "$EMPTY_BLOB $EMPTY_TREE" err &&
test_grep "$EMPTY_BLOB $EMPTY_TREE" .git/info/grafts
'
@@ -104,7 +104,7 @@ test_expect_success 'will not overwrite unstaged changes in renamed file' '
cp important other.c &&
if test "$GIT_TEST_MERGE_ALGORITHM" = ort
then
- test_must_fail git merge c1a >out 2>err &&
+ test_env GIT_ADVICE=1 test_must_fail git merge c1a >out 2>err &&
test_grep "would be overwritten by merge" err &&
test_cmp important other.c &&
test_path_is_missing .git/MERGE_HEAD
@@ -140,7 +140,7 @@ test_expect_success 'will not overwrite untracked file in leading path' '
rm -rf sub &&
cp important sub &&
cp important sub2 &&
- test_must_fail git merge sub 2>out &&
+ test_env GIT_ADVICE=1 test_must_fail git merge sub 2>out &&
test_cmp out expect &&
test_path_is_missing .git/MERGE_HEAD &&
test_cmp important sub &&
@@ -175,7 +175,7 @@ test_expect_success 'will not overwrite untracked file on unborn branch' '
git rm -fr . &&
git checkout --orphan new &&
cp important c0.c &&
- test_must_fail git merge c0 2>out &&
+ test_env GIT_ADVICE=1 test_must_fail git merge c0 2>out &&
test_cmp out expect
'
@@ -113,11 +113,11 @@ test_expect_success 'merging should conflict for non fast-forward' '
git checkout -b test-nonforward-a b &&
if test "$GIT_TEST_MERGE_ALGORITHM" = ort
then
- test_must_fail git merge c 2>actual &&
+ test_env GIT_ADVICE=1 test_must_fail git merge c 2>actual &&
sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short sub-c)" &&
grep "$sub_expect" actual
else
- test_must_fail git merge c 2> actual
+ test_env GIT_ADVICE=1 test_must_fail git merge c 2> actual
fi)
'
@@ -154,11 +154,11 @@ test_expect_success 'merging should conflict for non fast-forward (resolution ex
git rev-parse --short sub-d > ../expect) &&
if test "$GIT_TEST_MERGE_ALGORITHM" = ort
then
- test_must_fail git merge c >actual 2>sub-actual &&
+ test_env GIT_ADVICE=1 test_must_fail git merge c >actual 2>sub-actual &&
sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short sub-c)" &&
grep "$sub_expect" sub-actual
else
- test_must_fail git merge c 2> actual
+ test_env GIT_ADVICE=1 test_must_fail git merge c 2> actual
fi &&
grep $(cat expect) actual > /dev/null &&
git reset --hard)
@@ -181,11 +181,11 @@ test_expect_success 'merging should fail for ambiguous common parent' '
) &&
if test "$GIT_TEST_MERGE_ALGORITHM" = ort
then
- test_must_fail git merge c >actual 2>sub-actual &&
+ test_env GIT_ADVICE=1 test_must_fail git merge c >actual 2>sub-actual &&
sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short sub-c)" &&
grep "$sub_expect" sub-actual
else
- test_must_fail git merge c 2> actual
+ test_env GIT_ADVICE=1 test_must_fail git merge c 2> actual
fi &&
grep $(cat expect1) actual > /dev/null &&
grep $(cat expect2) actual > /dev/null &&
@@ -227,7 +227,7 @@ test_expect_success 'merging should fail for changes that are backwards' '
git commit -a -m "f" &&
git checkout -b test-backward e &&
- test_must_fail git merge f 2>actual &&
+ test_env GIT_ADVICE=1 test_must_fail git merge f 2>actual &&
if test "$GIT_TEST_MERGE_ALGORITHM" = ort
then
sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short sub-d)" &&
@@ -535,7 +535,7 @@ test_expect_success 'merging should fail with no merge base' '
git checkout -b b init &&
git add sub &&
git commit -m "b" &&
- test_must_fail git merge a 2>actual &&
+ test_env GIT_ADVICE=1 test_must_fail git merge a 2>actual &&
if test "$GIT_TEST_MERGE_ALGORITHM" = ort
then
sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short HEAD^1)" &&
@@ -40,13 +40,13 @@ Aborting
EOF
test_expect_success 'untracked files overwritten by merge (fast and non-fast forward)' '
- test_must_fail git merge branch 2>out &&
+ test_env GIT_ADVICE=1 test_must_fail git merge branch 2>out &&
test_cmp out expect &&
git commit --allow-empty -m empty &&
(
GIT_MERGE_VERBOSITY=0 &&
export GIT_MERGE_VERBOSITY &&
- test_must_fail git merge branch 2>out2
+ test_env GIT_ADVICE=1 test_must_fail git merge branch 2>out2
) &&
echo "Merge with strategy ${GIT_TEST_MERGE_ALGORITHM:-ort} failed." >>expect &&
test_cmp out2 expect &&
@@ -69,7 +69,7 @@ test_expect_success 'untracked files or local changes ovewritten by merge' '
git add two &&
git add three &&
git add four &&
- test_must_fail git merge branch 2>out &&
+ test_env GIT_ADVICE=1 test_must_fail git merge branch 2>out &&
test_cmp out expect
'
@@ -91,7 +91,7 @@ test_expect_success 'cannot switch branches because of local changes' '
git checkout main &&
echo uno >rep/one &&
echo dos >rep/two &&
- test_must_fail git checkout branch 2>out &&
+ test_env GIT_ADVICE=1 test_must_fail git checkout branch 2>out &&
test_cmp out expect
'
@@ -105,7 +105,7 @@ EOF
test_expect_success 'not uptodate file porcelain checkout error' '
git add rep/one rep/two &&
- test_must_fail git checkout branch 2>out &&
+ test_env GIT_ADVICE=1 test_must_fail git checkout branch 2>out &&
test_cmp out expect
'
@@ -136,7 +136,7 @@ test_expect_success 'not_uptodate_dir porcelain checkout error' '
git checkout main &&
>rep/untracked-file &&
>rep2/untracked-file &&
- test_must_fail git checkout branch 2>out &&
+ test_env GIT_ADVICE=1 test_must_fail git checkout branch 2>out &&
test_cmp out ../expect
'