Merge branch 'jc/test-i18ngrep'
Another step to deprecate test_i18ngrep. * jc/test-i18ngrep: tests: teach callers of test_i18ngrep to use test_grep test framework: further deprecate test_i18ngrepmaint
						commit
						a8e2394704
					
				|  | @ -161,7 +161,7 @@ test_expect_success 'git push properly warns about insufficient permissions' ' | ||||||
| 		git add foo.forbidden && | 		git add foo.forbidden && | ||||||
| 		git commit -m "add a file" && | 		git commit -m "add a file" && | ||||||
| 		git push 2>actual && | 		git push 2>actual && | ||||||
| 		test_i18ngrep "foo.forbidden is not a permitted file" actual | 		test_grep "foo.forbidden is not a permitted file" actual | ||||||
| 	) | 	) | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  |  | ||||||
|  | @ -255,7 +255,7 @@ test_http_push_nonff () { | ||||||
| 	' | 	' | ||||||
|  |  | ||||||
| 	test_expect_success 'non-fast-forward push shows help message' ' | 	test_expect_success 'non-fast-forward push shows help message' ' | ||||||
| 		test_i18ngrep "Updates were rejected because" output | 		test_grep "Updates were rejected because" output | ||||||
| 	' | 	' | ||||||
|  |  | ||||||
| 	test_expect_${EXPECT_CAS_RESULT} 'force with lease aka cas' ' | 	test_expect_${EXPECT_CAS_RESULT} 'force with lease aka cas' ' | ||||||
|  |  | ||||||
|  | @ -830,7 +830,7 @@ test_submodule_recursing_with_args_common () { | ||||||
| 			cd submodule_update && | 			cd submodule_update && | ||||||
| 			git branch -t invalid_sub1 origin/invalid_sub1 && | 			git branch -t invalid_sub1 origin/invalid_sub1 && | ||||||
| 			test_must_fail $command invalid_sub1 2>err && | 			test_must_fail $command invalid_sub1 2>err && | ||||||
| 			test_i18ngrep sub1 err && | 			test_grep sub1 err && | ||||||
| 			test_superproject_content origin/add_sub1 && | 			test_superproject_content origin/add_sub1 && | ||||||
| 			test_submodule_content sub1 origin/add_sub1 | 			test_submodule_content sub1 origin/add_sub1 | ||||||
| 		) | 		) | ||||||
|  |  | ||||||
|  | @ -168,8 +168,8 @@ test_expect_success 'reinit' ' | ||||||
| 		git -c init.defaultBranch=initial init >out1 2>err1 && | 		git -c init.defaultBranch=initial init >out1 2>err1 && | ||||||
| 		git init >out2 2>err2 | 		git init >out2 2>err2 | ||||||
| 	) && | 	) && | ||||||
| 	test_i18ngrep "Initialized empty" again/out1 && | 	test_grep "Initialized empty" again/out1 && | ||||||
| 	test_i18ngrep "Reinitialized existing" again/out2 && | 	test_grep "Reinitialized existing" again/out2 && | ||||||
| 	test_must_be_empty again/err1 && | 	test_must_be_empty again/err1 && | ||||||
| 	test_must_be_empty again/err2 | 	test_must_be_empty again/err2 | ||||||
| ' | ' | ||||||
|  | @ -332,7 +332,7 @@ test_expect_success 'init with separate gitdir' ' | ||||||
|  |  | ||||||
| test_expect_success 'explicit bare & --separate-git-dir incompatible' ' | test_expect_success 'explicit bare & --separate-git-dir incompatible' ' | ||||||
| 	test_must_fail git init --bare --separate-git-dir goop.git bare.git 2>err && | 	test_must_fail git init --bare --separate-git-dir goop.git bare.git 2>err && | ||||||
| 	test_i18ngrep "cannot be used together" err | 	test_grep "cannot be used together" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'implicit bare & --separate-git-dir incompatible' ' | test_expect_success 'implicit bare & --separate-git-dir incompatible' ' | ||||||
|  | @ -340,7 +340,7 @@ test_expect_success 'implicit bare & --separate-git-dir incompatible' ' | ||||||
| 	mkdir -p bare.git && | 	mkdir -p bare.git && | ||||||
| 	test_must_fail env GIT_DIR=. \ | 	test_must_fail env GIT_DIR=. \ | ||||||
| 		git -C bare.git init --separate-git-dir goop.git 2>err && | 		git -C bare.git init --separate-git-dir goop.git 2>err && | ||||||
| 	test_i18ngrep "incompatible" err | 	test_grep "incompatible" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'bare & --separate-git-dir incompatible within worktree' ' | test_expect_success 'bare & --separate-git-dir incompatible within worktree' ' | ||||||
|  | @ -349,7 +349,7 @@ test_expect_success 'bare & --separate-git-dir incompatible within worktree' ' | ||||||
| 	git clone --bare . bare.git && | 	git clone --bare . bare.git && | ||||||
| 	git -C bare.git worktree add --detach ../linkwt && | 	git -C bare.git worktree add --detach ../linkwt && | ||||||
| 	test_must_fail git -C linkwt init --separate-git-dir seprepo 2>err && | 	test_must_fail git -C linkwt init --separate-git-dir seprepo 2>err && | ||||||
| 	test_i18ngrep "incompatible" err | 	test_grep "incompatible" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_lazy_prereq GETCWD_IGNORES_PERMS ' | test_lazy_prereq GETCWD_IGNORES_PERMS ' | ||||||
|  | @ -563,7 +563,7 @@ test_expect_success '--initial-branch' ' | ||||||
|  |  | ||||||
| 	: re-initializing should not change the branch name && | 	: re-initializing should not change the branch name && | ||||||
| 	git init --initial-branch=ignore initial-branch-option 2>err && | 	git init --initial-branch=ignore initial-branch-option 2>err && | ||||||
| 	test_i18ngrep "ignored --initial-branch" err && | 	test_grep "ignored --initial-branch" err && | ||||||
| 	git -C initial-branch-option symbolic-ref HEAD >actual && | 	git -C initial-branch-option symbolic-ref HEAD >actual && | ||||||
| 	grep hello actual | 	grep hello actual | ||||||
| ' | ' | ||||||
|  | @ -579,7 +579,7 @@ test_expect_success 'advice on unconfigured init.defaultBranch' ' | ||||||
| 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= git -c color.advice=always \ | 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= git -c color.advice=always \ | ||||||
| 		init unconfigured-default-branch-name 2>err && | 		init unconfigured-default-branch-name 2>err && | ||||||
| 	test_decode_color <err >decoded && | 	test_decode_color <err >decoded && | ||||||
| 	test_i18ngrep "<YELLOW>hint: " decoded | 	test_grep "<YELLOW>hint: " decoded | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'overridden default main branch name (env)' ' | test_expect_success 'overridden default main branch name (env)' ' | ||||||
|  | @ -592,7 +592,7 @@ test_expect_success 'overridden default main branch name (env)' ' | ||||||
| test_expect_success 'invalid default branch name' ' | test_expect_success 'invalid default branch name' ' | ||||||
| 	test_must_fail env GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME="with space" \ | 	test_must_fail env GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME="with space" \ | ||||||
| 		git init initial-branch-invalid 2>err && | 		git init initial-branch-invalid 2>err && | ||||||
| 	test_i18ngrep "invalid branch name" err | 	test_grep "invalid branch name" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'branch -m with the initial branch' ' | test_expect_success 'branch -m with the initial branch' ' | ||||||
|  |  | ||||||
|  | @ -22,13 +22,13 @@ test_expect_success 'initial setup' ' | ||||||
| test_expect_success 'bad setup: invalid .git file format' ' | test_expect_success 'bad setup: invalid .git file format' ' | ||||||
| 	echo "gitdir $REAL" >.git && | 	echo "gitdir $REAL" >.git && | ||||||
| 	test_must_fail git rev-parse 2>.err && | 	test_must_fail git rev-parse 2>.err && | ||||||
| 	test_i18ngrep "invalid gitfile format" .err | 	test_grep "invalid gitfile format" .err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'bad setup: invalid .git file path' ' | test_expect_success 'bad setup: invalid .git file path' ' | ||||||
| 	echo "gitdir: $REAL.not" >.git && | 	echo "gitdir: $REAL.not" >.git && | ||||||
| 	test_must_fail git rev-parse 2>.err && | 	test_must_fail git rev-parse 2>.err && | ||||||
| 	test_i18ngrep "not a git repository" .err | 	test_grep "not a git repository" .err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'final setup + check rev-parse --git-dir' ' | test_expect_success 'final setup + check rev-parse --git-dir' ' | ||||||
|  |  | ||||||
|  | @ -263,7 +263,7 @@ test_expect_success 'root subdir attribute test' ' | ||||||
| test_expect_success 'negative patterns' ' | test_expect_success 'negative patterns' ' | ||||||
| 	echo "!f test=bar" >.gitattributes && | 	echo "!f test=bar" >.gitattributes && | ||||||
| 	git check-attr test -- '"'"'!f'"'"' 2>errors && | 	git check-attr test -- '"'"'!f'"'"' 2>errors && | ||||||
| 	test_i18ngrep "Negative patterns are ignored" errors | 	test_grep "Negative patterns are ignored" errors | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'patterns starting with exclamation' ' | test_expect_success 'patterns starting with exclamation' ' | ||||||
|  | @ -496,7 +496,7 @@ test_expect_success SYMLINKS 'symlinks not respected in-tree' ' | ||||||
| 	mkdir subdir && | 	mkdir subdir && | ||||||
| 	ln -s ../attr subdir/.gitattributes && | 	ln -s ../attr subdir/.gitattributes && | ||||||
| 	attr_check_basic subdir/file unspecified && | 	attr_check_basic subdir/file unspecified && | ||||||
| 	test_i18ngrep "unable to access.*gitattributes" err | 	test_grep "unable to access.*gitattributes" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'large attributes line ignored in tree' ' | test_expect_success 'large attributes line ignored in tree' ' | ||||||
|  |  | ||||||
|  | @ -49,7 +49,7 @@ broken_c_unquote_verbose () { | ||||||
|  |  | ||||||
| stderr_contains () { | stderr_contains () { | ||||||
| 	regexp="$1" | 	regexp="$1" | ||||||
| 	if test_i18ngrep "$regexp" "$HOME/stderr" | 	if test_grep "$regexp" "$HOME/stderr" | ||||||
| 	then | 	then | ||||||
| 		return 0 | 		return 0 | ||||||
| 	else | 	else | ||||||
|  | @ -942,7 +942,7 @@ test_expect_success SYMLINKS 'symlinks not respected in-tree' ' | ||||||
| 	ln -s ignore subdir/.gitignore && | 	ln -s ignore subdir/.gitignore && | ||||||
| 	test_must_fail git check-ignore subdir/file >actual 2>err && | 	test_must_fail git check-ignore subdir/file >actual 2>err && | ||||||
| 	test_must_be_empty actual && | 	test_must_be_empty actual && | ||||||
| 	test_i18ngrep "unable to access.*gitignore" err | 	test_grep "unable to access.*gitignore" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_done | test_done | ||||||
|  |  | ||||||
|  | @ -100,17 +100,17 @@ test_expect_success "--help does not work for guides" " | ||||||
|  |  | ||||||
| test_expect_success 'git help' ' | test_expect_success 'git help' ' | ||||||
| 	git help >help.output && | 	git help >help.output && | ||||||
| 	test_i18ngrep "^   clone  " help.output && | 	test_grep "^   clone  " help.output && | ||||||
| 	test_i18ngrep "^   add    " help.output && | 	test_grep "^   add    " help.output && | ||||||
| 	test_i18ngrep "^   log    " help.output && | 	test_grep "^   log    " help.output && | ||||||
| 	test_i18ngrep "^   commit " help.output && | 	test_grep "^   commit " help.output && | ||||||
| 	test_i18ngrep "^   fetch  " help.output | 	test_grep "^   fetch  " help.output | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'git help -g' ' | test_expect_success 'git help -g' ' | ||||||
| 	git help -g >help.output && | 	git help -g >help.output && | ||||||
| 	test_i18ngrep "^   everyday   " help.output && | 	test_grep "^   everyday   " help.output && | ||||||
| 	test_i18ngrep "^   tutorial   " help.output | 	test_grep "^   tutorial   " help.output | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'git help fails for non-existing html pages' ' | test_expect_success 'git help fails for non-existing html pages' ' | ||||||
|  | @ -257,7 +257,7 @@ do | ||||||
| 			export GIT_CEILING_DIRECTORIES && | 			export GIT_CEILING_DIRECTORIES && | ||||||
| 			test_expect_code 129 git -C sub $builtin -h >output 2>&1 | 			test_expect_code 129 git -C sub $builtin -h >output 2>&1 | ||||||
| 		) && | 		) && | ||||||
| 		test_i18ngrep usage output | 		test_grep usage output | ||||||
| 	' | 	' | ||||||
| done <builtins | done <builtins | ||||||
|  |  | ||||||
|  |  | ||||||
|  | @ -16,7 +16,7 @@ fi | ||||||
|  |  | ||||||
| test_expect_success 'test-sha1 detects shattered pdf' ' | test_expect_success 'test-sha1 detects shattered pdf' ' | ||||||
| 	test_must_fail test-tool sha1 <"$TEST_DATA/shattered-1.pdf" 2>err && | 	test_must_fail test-tool sha1 <"$TEST_DATA/shattered-1.pdf" 2>err && | ||||||
| 	test_i18ngrep collision err && | 	test_grep collision err && | ||||||
| 	grep 38762cf7f55934b34d179ae6a4c80cadccbb7f0a err | 	grep 38762cf7f55934b34d179ae6a4c80cadccbb7f0a err | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  |  | ||||||
|  | @ -8,7 +8,7 @@ test_expect_success 'nested aliases - internal execution' ' | ||||||
| 	git config alias.nested-internal-1 nested-internal-2 && | 	git config alias.nested-internal-1 nested-internal-2 && | ||||||
| 	git config alias.nested-internal-2 status && | 	git config alias.nested-internal-2 status && | ||||||
| 	git nested-internal-1 >output && | 	git nested-internal-1 >output && | ||||||
| 	test_i18ngrep "^On branch " output | 	test_grep "^On branch " output | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'nested aliases - mixed execution' ' | test_expect_success 'nested aliases - mixed execution' ' | ||||||
|  | @ -16,7 +16,7 @@ test_expect_success 'nested aliases - mixed execution' ' | ||||||
| 	git config alias.nested-external-2 "!git nested-external-3" && | 	git config alias.nested-external-2 "!git nested-external-3" && | ||||||
| 	git config alias.nested-external-3 status && | 	git config alias.nested-external-3 status && | ||||||
| 	git nested-external-1 >output && | 	git nested-external-1 >output && | ||||||
| 	test_i18ngrep "^On branch " output | 	test_grep "^On branch " output | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'looping aliases - internal execution' ' | test_expect_success 'looping aliases - internal execution' ' | ||||||
|  | @ -24,7 +24,7 @@ test_expect_success 'looping aliases - internal execution' ' | ||||||
| 	git config alias.loop-internal-2 loop-internal-3 && | 	git config alias.loop-internal-2 loop-internal-3 && | ||||||
| 	git config alias.loop-internal-3 loop-internal-2 && | 	git config alias.loop-internal-3 loop-internal-2 && | ||||||
| 	test_must_fail git loop-internal-1 2>output && | 	test_must_fail git loop-internal-1 2>output && | ||||||
| 	test_i18ngrep "^fatal: alias loop detected: expansion of" output | 	test_grep "^fatal: alias loop detected: expansion of" output | ||||||
| ' | ' | ||||||
|  |  | ||||||
| # This test is disabled until external loops are fixed, because would block | # This test is disabled until external loops are fixed, because would block | ||||||
|  | @ -34,7 +34,7 @@ test_expect_success 'looping aliases - internal execution' ' | ||||||
| #	git config alias.loop-mixed-1 loop-mixed-2 && | #	git config alias.loop-mixed-1 loop-mixed-2 && | ||||||
| #	git config alias.loop-mixed-2 "!git loop-mixed-1" && | #	git config alias.loop-mixed-2 "!git loop-mixed-1" && | ||||||
| #	test_must_fail git loop-mixed-1 2>output && | #	test_must_fail git loop-mixed-1 2>output && | ||||||
| #	test_i18ngrep "^fatal: alias loop detected: expansion of" output | #	test_grep "^fatal: alias loop detected: expansion of" output | ||||||
| #' | #' | ||||||
|  |  | ||||||
| test_expect_success 'run-command formats empty args properly' ' | test_expect_success 'run-command formats empty args properly' ' | ||||||
|  |  | ||||||
|  | @ -263,7 +263,7 @@ test_expect_success 'required filter with absent clean field' ' | ||||||
|  |  | ||||||
| 	echo test >test.ac && | 	echo test >test.ac && | ||||||
| 	test_must_fail git add test.ac 2>stderr && | 	test_must_fail git add test.ac 2>stderr && | ||||||
| 	test_i18ngrep "fatal: test.ac: clean filter .absentclean. failed" stderr | 	test_grep "fatal: test.ac: clean filter .absentclean. failed" stderr | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'required filter with absent smudge field' ' | test_expect_success 'required filter with absent smudge field' ' | ||||||
|  | @ -276,7 +276,7 @@ test_expect_success 'required filter with absent smudge field' ' | ||||||
| 	git add test.as && | 	git add test.as && | ||||||
| 	rm -f test.as && | 	rm -f test.as && | ||||||
| 	test_must_fail git checkout -- test.as 2>stderr && | 	test_must_fail git checkout -- test.as 2>stderr && | ||||||
| 	test_i18ngrep "fatal: test.as: smudge filter absentsmudge failed" stderr | 	test_grep "fatal: test.as: smudge filter absentsmudge failed" stderr | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'filtering large input to small output should use little memory' ' | test_expect_success 'filtering large input to small output should use little memory' ' | ||||||
|  | @ -733,7 +733,7 @@ test_expect_success 'process filter should restart after unexpected write failur | ||||||
| 		git checkout --quiet --no-progress . 2>git-stderr.log && | 		git checkout --quiet --no-progress . 2>git-stderr.log && | ||||||
|  |  | ||||||
| 		grep "smudge write error" git-stderr.log && | 		grep "smudge write error" git-stderr.log && | ||||||
| 		test_i18ngrep "error: external filter" git-stderr.log && | 		test_grep "error: external filter" git-stderr.log && | ||||||
|  |  | ||||||
| 		cat >expected.log <<-EOF && | 		cat >expected.log <<-EOF && | ||||||
| 			START | 			START | ||||||
|  |  | ||||||
|  | @ -92,23 +92,23 @@ do | ||||||
| 		# In these cases the BOM is prohibited. | 		# In these cases the BOM is prohibited. | ||||||
| 		cp bebom.utf${i}be.raw bebom.utf${i}be && | 		cp bebom.utf${i}be.raw bebom.utf${i}be && | ||||||
| 		test_must_fail git add bebom.utf${i}be 2>err.out && | 		test_must_fail git add bebom.utf${i}be 2>err.out && | ||||||
| 		test_i18ngrep "fatal: BOM is prohibited .* utf-${i}be" err.out && | 		test_grep "fatal: BOM is prohibited .* utf-${i}be" err.out && | ||||||
| 		test_i18ngrep "use UTF-${i} as working-tree-encoding" err.out && | 		test_grep "use UTF-${i} as working-tree-encoding" err.out && | ||||||
|  |  | ||||||
| 		cp lebom.utf${i}le.raw lebom.utf${i}be && | 		cp lebom.utf${i}le.raw lebom.utf${i}be && | ||||||
| 		test_must_fail git add lebom.utf${i}be 2>err.out && | 		test_must_fail git add lebom.utf${i}be 2>err.out && | ||||||
| 		test_i18ngrep "fatal: BOM is prohibited .* utf-${i}be" err.out && | 		test_grep "fatal: BOM is prohibited .* utf-${i}be" err.out && | ||||||
| 		test_i18ngrep "use UTF-${i} as working-tree-encoding" err.out && | 		test_grep "use UTF-${i} as working-tree-encoding" err.out && | ||||||
|  |  | ||||||
| 		cp bebom.utf${i}be.raw bebom.utf${i}le && | 		cp bebom.utf${i}be.raw bebom.utf${i}le && | ||||||
| 		test_must_fail git add bebom.utf${i}le 2>err.out && | 		test_must_fail git add bebom.utf${i}le 2>err.out && | ||||||
| 		test_i18ngrep "fatal: BOM is prohibited .* utf-${i}LE" err.out && | 		test_grep "fatal: BOM is prohibited .* utf-${i}LE" err.out && | ||||||
| 		test_i18ngrep "use UTF-${i} as working-tree-encoding" err.out && | 		test_grep "use UTF-${i} as working-tree-encoding" err.out && | ||||||
|  |  | ||||||
| 		cp lebom.utf${i}le.raw lebom.utf${i}le && | 		cp lebom.utf${i}le.raw lebom.utf${i}le && | ||||||
| 		test_must_fail git add lebom.utf${i}le 2>err.out && | 		test_must_fail git add lebom.utf${i}le 2>err.out && | ||||||
| 		test_i18ngrep "fatal: BOM is prohibited .* utf-${i}LE" err.out && | 		test_grep "fatal: BOM is prohibited .* utf-${i}LE" err.out && | ||||||
| 		test_i18ngrep "use UTF-${i} as working-tree-encoding" err.out | 		test_grep "use UTF-${i} as working-tree-encoding" err.out | ||||||
| 	' | 	' | ||||||
|  |  | ||||||
| 	test_expect_success "check required UTF-${i} BOM" ' | 	test_expect_success "check required UTF-${i} BOM" ' | ||||||
|  | @ -118,13 +118,13 @@ do | ||||||
|  |  | ||||||
| 		cp nobom.utf${i}be.raw nobom.utf${i} && | 		cp nobom.utf${i}be.raw nobom.utf${i} && | ||||||
| 		test_must_fail git add nobom.utf${i} 2>err.out && | 		test_must_fail git add nobom.utf${i} 2>err.out && | ||||||
| 		test_i18ngrep "fatal: BOM is required .* utf-${i}" err.out && | 		test_grep "fatal: BOM is required .* utf-${i}" err.out && | ||||||
| 		test_i18ngrep "use UTF-${i}BE or UTF-${i}LE" err.out && | 		test_grep "use UTF-${i}BE or UTF-${i}LE" err.out && | ||||||
|  |  | ||||||
| 		cp nobom.utf${i}le.raw nobom.utf${i} && | 		cp nobom.utf${i}le.raw nobom.utf${i} && | ||||||
| 		test_must_fail git add nobom.utf${i} 2>err.out && | 		test_must_fail git add nobom.utf${i} 2>err.out && | ||||||
| 		test_i18ngrep "fatal: BOM is required .* utf-${i}" err.out && | 		test_grep "fatal: BOM is required .* utf-${i}" err.out && | ||||||
| 		test_i18ngrep "use UTF-${i}BE or UTF-${i}LE" err.out | 		test_grep "use UTF-${i}BE or UTF-${i}LE" err.out | ||||||
| 	' | 	' | ||||||
|  |  | ||||||
| 	test_expect_success "eol conversion for UTF-${i} encoded files on checkout" ' | 	test_expect_success "eol conversion for UTF-${i} encoded files on checkout" ' | ||||||
|  | @ -169,7 +169,7 @@ test_expect_success 'check unsupported encodings' ' | ||||||
| 	echo "*.set text working-tree-encoding" >.gitattributes && | 	echo "*.set text working-tree-encoding" >.gitattributes && | ||||||
| 	printf "set" >t.set && | 	printf "set" >t.set && | ||||||
| 	test_must_fail git add t.set 2>err.out && | 	test_must_fail git add t.set 2>err.out && | ||||||
| 	test_i18ngrep "true/false are no valid working-tree-encodings" err.out && | 	test_grep "true/false are no valid working-tree-encodings" err.out && | ||||||
|  |  | ||||||
| 	echo "*.unset text -working-tree-encoding" >.gitattributes && | 	echo "*.unset text -working-tree-encoding" >.gitattributes && | ||||||
| 	printf "unset" >t.unset && | 	printf "unset" >t.unset && | ||||||
|  | @ -182,7 +182,7 @@ test_expect_success 'check unsupported encodings' ' | ||||||
| 	echo "*.garbage text working-tree-encoding=garbage" >.gitattributes && | 	echo "*.garbage text working-tree-encoding=garbage" >.gitattributes && | ||||||
| 	printf "garbage" >t.garbage && | 	printf "garbage" >t.garbage && | ||||||
| 	test_must_fail git add t.garbage 2>err.out && | 	test_must_fail git add t.garbage 2>err.out && | ||||||
| 	test_i18ngrep "failed to encode" err.out | 	test_grep "failed to encode" err.out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'error if encoding round trip is not the same during refresh' ' | test_expect_success 'error if encoding round trip is not the same during refresh' ' | ||||||
|  | @ -201,7 +201,7 @@ test_expect_success 'error if encoding round trip is not the same during refresh | ||||||
| 	git update-ref refs/heads/main $COMMIT && | 	git update-ref refs/heads/main $COMMIT && | ||||||
|  |  | ||||||
| 	test_must_fail git checkout HEAD^ 2>err.out && | 	test_must_fail git checkout HEAD^ 2>err.out && | ||||||
| 	test_i18ngrep "error: .* overwritten by checkout:" err.out | 	test_grep "error: .* overwritten by checkout:" err.out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'error if encoding garbage is already in Git' ' | test_expect_success 'error if encoding garbage is already in Git' ' | ||||||
|  | @ -217,7 +217,7 @@ test_expect_success 'error if encoding garbage is already in Git' ' | ||||||
| 	git update-ref refs/heads/main $COMMIT && | 	git update-ref refs/heads/main $COMMIT && | ||||||
|  |  | ||||||
| 	git diff 2>err.out && | 	git diff 2>err.out && | ||||||
| 	test_i18ngrep "error: BOM is required" err.out | 	test_grep "error: BOM is required" err.out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_lazy_prereq ICONV_SHIFT_JIS ' | test_lazy_prereq ICONV_SHIFT_JIS ' | ||||||
|  |  | ||||||
|  | @ -374,34 +374,34 @@ test_expect_success 'OPT_CMDMODE() works' ' | ||||||
| test_expect_success 'OPT_CMDMODE() detects incompatibility (1)' ' | test_expect_success 'OPT_CMDMODE() detects incompatibility (1)' ' | ||||||
| 	test_must_fail test-tool parse-options --mode1 --mode2 >output 2>output.err && | 	test_must_fail test-tool parse-options --mode1 --mode2 >output 2>output.err && | ||||||
| 	test_must_be_empty output && | 	test_must_be_empty output && | ||||||
| 	test_i18ngrep "mode1" output.err && | 	test_grep "mode1" output.err && | ||||||
| 	test_i18ngrep "mode2" output.err && | 	test_grep "mode2" output.err && | ||||||
| 	test_i18ngrep "is incompatible with" output.err | 	test_grep "is incompatible with" output.err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'OPT_CMDMODE() detects incompatibility (2)' ' | test_expect_success 'OPT_CMDMODE() detects incompatibility (2)' ' | ||||||
| 	test_must_fail test-tool parse-options --set23 --mode2 >output 2>output.err && | 	test_must_fail test-tool parse-options --set23 --mode2 >output 2>output.err && | ||||||
| 	test_must_be_empty output && | 	test_must_be_empty output && | ||||||
| 	test_i18ngrep "mode2" output.err && | 	test_grep "mode2" output.err && | ||||||
| 	test_i18ngrep "set23" output.err && | 	test_grep "set23" output.err && | ||||||
| 	test_i18ngrep "is incompatible with" output.err | 	test_grep "is incompatible with" output.err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'OPT_CMDMODE() detects incompatibility (3)' ' | test_expect_success 'OPT_CMDMODE() detects incompatibility (3)' ' | ||||||
| 	test_must_fail test-tool parse-options --mode2 --set23 >output 2>output.err && | 	test_must_fail test-tool parse-options --mode2 --set23 >output 2>output.err && | ||||||
| 	test_must_be_empty output && | 	test_must_be_empty output && | ||||||
| 	test_i18ngrep "mode2" output.err && | 	test_grep "mode2" output.err && | ||||||
| 	test_i18ngrep "set23" output.err && | 	test_grep "set23" output.err && | ||||||
| 	test_i18ngrep "is incompatible with" output.err | 	test_grep "is incompatible with" output.err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'OPT_CMDMODE() detects incompatibility (4)' ' | test_expect_success 'OPT_CMDMODE() detects incompatibility (4)' ' | ||||||
| 	test_must_fail test-tool parse-options --mode2 --mode34=3 \ | 	test_must_fail test-tool parse-options --mode2 --mode34=3 \ | ||||||
| 		>output 2>output.err && | 		>output 2>output.err && | ||||||
| 	test_must_be_empty output && | 	test_must_be_empty output && | ||||||
| 	test_i18ngrep "mode2" output.err && | 	test_grep "mode2" output.err && | ||||||
| 	test_i18ngrep "mode34.3" output.err && | 	test_grep "mode34.3" output.err && | ||||||
| 	test_i18ngrep "is incompatible with" output.err | 	test_grep "is incompatible with" output.err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'OPT_COUNTUP() with PARSE_OPT_NODASH works' ' | test_expect_success 'OPT_COUNTUP() with PARSE_OPT_NODASH works' ' | ||||||
|  |  | ||||||
|  | @ -21,8 +21,8 @@ test_expect_success 'tag --contains <existent_tag>' ' | ||||||
| test_expect_success 'tag --contains <inexistent_tag>' ' | test_expect_success 'tag --contains <inexistent_tag>' ' | ||||||
| 	test_must_fail git tag --contains "notag" >actual 2>actual.err && | 	test_must_fail git tag --contains "notag" >actual 2>actual.err && | ||||||
| 	test_line_count = 0 actual && | 	test_line_count = 0 actual && | ||||||
| 	test_i18ngrep "error" actual.err && | 	test_grep "error" actual.err && | ||||||
| 	test_i18ngrep ! "usage" actual.err | 	test_grep ! "usage" actual.err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'tag --no-contains <existent_tag>' ' | test_expect_success 'tag --no-contains <existent_tag>' ' | ||||||
|  | @ -34,27 +34,27 @@ test_expect_success 'tag --no-contains <existent_tag>' ' | ||||||
| test_expect_success 'tag --no-contains <inexistent_tag>' ' | test_expect_success 'tag --no-contains <inexistent_tag>' ' | ||||||
| 	test_must_fail git tag --no-contains "notag" >actual 2>actual.err && | 	test_must_fail git tag --no-contains "notag" >actual 2>actual.err && | ||||||
| 	test_line_count = 0 actual && | 	test_line_count = 0 actual && | ||||||
| 	test_i18ngrep "error" actual.err && | 	test_grep "error" actual.err && | ||||||
| 	test_i18ngrep ! "usage" actual.err | 	test_grep ! "usage" actual.err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'tag usage error' ' | test_expect_success 'tag usage error' ' | ||||||
| 	test_must_fail git tag --noopt >actual 2>actual.err && | 	test_must_fail git tag --noopt >actual 2>actual.err && | ||||||
| 	test_line_count = 0 actual && | 	test_line_count = 0 actual && | ||||||
| 	test_i18ngrep "usage" actual.err | 	test_grep "usage" actual.err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'branch --contains <existent_commit>' ' | test_expect_success 'branch --contains <existent_commit>' ' | ||||||
| 	git branch --contains "main" >actual 2>actual.err && | 	git branch --contains "main" >actual 2>actual.err && | ||||||
| 	test_i18ngrep "main" actual && | 	test_grep "main" actual && | ||||||
| 	test_line_count = 0 actual.err | 	test_line_count = 0 actual.err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'branch --contains <inexistent_commit>' ' | test_expect_success 'branch --contains <inexistent_commit>' ' | ||||||
| 	test_must_fail git branch --no-contains "nocommit" >actual 2>actual.err && | 	test_must_fail git branch --no-contains "nocommit" >actual 2>actual.err && | ||||||
| 	test_line_count = 0 actual && | 	test_line_count = 0 actual && | ||||||
| 	test_i18ngrep "error" actual.err && | 	test_grep "error" actual.err && | ||||||
| 	test_i18ngrep ! "usage" actual.err | 	test_grep ! "usage" actual.err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'branch --no-contains <existent_commit>' ' | test_expect_success 'branch --no-contains <existent_commit>' ' | ||||||
|  | @ -66,14 +66,14 @@ test_expect_success 'branch --no-contains <existent_commit>' ' | ||||||
| test_expect_success 'branch --no-contains <inexistent_commit>' ' | test_expect_success 'branch --no-contains <inexistent_commit>' ' | ||||||
| 	test_must_fail git branch --no-contains "nocommit" >actual 2>actual.err && | 	test_must_fail git branch --no-contains "nocommit" >actual 2>actual.err && | ||||||
| 	test_line_count = 0 actual && | 	test_line_count = 0 actual && | ||||||
| 	test_i18ngrep "error" actual.err && | 	test_grep "error" actual.err && | ||||||
| 	test_i18ngrep ! "usage" actual.err | 	test_grep ! "usage" actual.err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'branch usage error' ' | test_expect_success 'branch usage error' ' | ||||||
| 	test_must_fail git branch --noopt >actual 2>actual.err && | 	test_must_fail git branch --noopt >actual 2>actual.err && | ||||||
| 	test_line_count = 0 actual && | 	test_line_count = 0 actual && | ||||||
| 	test_i18ngrep "usage" actual.err | 	test_grep "usage" actual.err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'for-each-ref --contains <existent_object>' ' | test_expect_success 'for-each-ref --contains <existent_object>' ' | ||||||
|  | @ -85,8 +85,8 @@ test_expect_success 'for-each-ref --contains <existent_object>' ' | ||||||
| test_expect_success 'for-each-ref --contains <inexistent_object>' ' | test_expect_success 'for-each-ref --contains <inexistent_object>' ' | ||||||
| 	test_must_fail git for-each-ref --no-contains "noobject" >actual 2>actual.err && | 	test_must_fail git for-each-ref --no-contains "noobject" >actual 2>actual.err && | ||||||
| 	test_line_count = 0 actual && | 	test_line_count = 0 actual && | ||||||
| 	test_i18ngrep "error" actual.err && | 	test_grep "error" actual.err && | ||||||
| 	test_i18ngrep ! "usage" actual.err | 	test_grep ! "usage" actual.err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'for-each-ref --no-contains <existent_object>' ' | test_expect_success 'for-each-ref --no-contains <existent_object>' ' | ||||||
|  | @ -98,14 +98,14 @@ test_expect_success 'for-each-ref --no-contains <existent_object>' ' | ||||||
| test_expect_success 'for-each-ref --no-contains <inexistent_object>' ' | test_expect_success 'for-each-ref --no-contains <inexistent_object>' ' | ||||||
| 	test_must_fail git for-each-ref --no-contains "noobject" >actual 2>actual.err && | 	test_must_fail git for-each-ref --no-contains "noobject" >actual 2>actual.err && | ||||||
| 	test_line_count = 0 actual && | 	test_line_count = 0 actual && | ||||||
| 	test_i18ngrep "error" actual.err && | 	test_grep "error" actual.err && | ||||||
| 	test_i18ngrep ! "usage" actual.err | 	test_grep ! "usage" actual.err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'for-each-ref usage error' ' | test_expect_success 'for-each-ref usage error' ' | ||||||
| 	test_must_fail git for-each-ref --noopt >actual 2>actual.err && | 	test_must_fail git for-each-ref --noopt >actual 2>actual.err && | ||||||
| 	test_line_count = 0 actual && | 	test_line_count = 0 actual && | ||||||
| 	test_i18ngrep "usage" actual.err | 	test_grep "usage" actual.err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_done | test_done | ||||||
|  |  | ||||||
|  | @ -19,12 +19,12 @@ test_expect_success MINGW 'subprocess inherits only std handles' ' | ||||||
|  |  | ||||||
| test_expect_success 'start_command reports ENOENT (slash)' ' | test_expect_success 'start_command reports ENOENT (slash)' ' | ||||||
| 	test-tool run-command start-command-ENOENT ./does-not-exist 2>err && | 	test-tool run-command start-command-ENOENT ./does-not-exist 2>err && | ||||||
| 	test_i18ngrep "\./does-not-exist" err | 	test_grep "\./does-not-exist" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'start_command reports ENOENT (no slash)' ' | test_expect_success 'start_command reports ENOENT (no slash)' ' | ||||||
| 	test-tool run-command start-command-ENOENT does-not-exist 2>err && | 	test-tool run-command start-command-ENOENT does-not-exist 2>err && | ||||||
| 	test_i18ngrep "does-not-exist" err | 	test_grep "does-not-exist" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'run_command can run a command' ' | test_expect_success 'run_command can run a command' ' | ||||||
|  | @ -49,7 +49,7 @@ test_expect_success !RUNS_COMMANDS_FROM_PWD 'run_command is restricted to PATH' | ||||||
| 	echo yikes | 	echo yikes | ||||||
| 	EOF | 	EOF | ||||||
| 	test_must_fail test-tool run-command run-command should-not-run 2>err && | 	test_must_fail test-tool run-command run-command should-not-run 2>err && | ||||||
| 	test_i18ngrep "should-not-run" err | 	test_grep "should-not-run" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success !MINGW 'run_command can run a script without a #! line' ' | test_expect_success !MINGW 'run_command can run a script without a #! line' ' | ||||||
|  |  | ||||||
|  | @ -44,13 +44,13 @@ test_expect_success 'incomplete sideband messages are reassembled' ' | ||||||
| test_expect_success 'eof on sideband message is reported' ' | test_expect_success 'eof on sideband message is reported' ' | ||||||
| 	printf 1234 >input && | 	printf 1234 >input && | ||||||
| 	test-tool pkt-line receive-sideband <input 2>err && | 	test-tool pkt-line receive-sideband <input 2>err && | ||||||
| 	test_i18ngrep "unexpected disconnect" err | 	test_grep "unexpected disconnect" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'missing sideband designator is reported' ' | test_expect_success 'missing sideband designator is reported' ' | ||||||
| 	printf 0004 >input && | 	printf 0004 >input && | ||||||
| 	test-tool pkt-line receive-sideband <input 2>err && | 	test-tool pkt-line receive-sideband <input 2>err && | ||||||
| 	test_i18ngrep "missing sideband" err | 	test_grep "missing sideband" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_done | test_done | ||||||
|  |  | ||||||
|  | @ -65,14 +65,14 @@ test_expect_success '--output-directory puts the report in the provided dir' ' | ||||||
|  |  | ||||||
| test_expect_success 'incorrect arguments abort with usage' ' | test_expect_success 'incorrect arguments abort with usage' ' | ||||||
| 	test_must_fail git bugreport --false 2>output && | 	test_must_fail git bugreport --false 2>output && | ||||||
| 	grep usage output && | 	test_grep usage output && | ||||||
| 	test_path_is_missing git-bugreport-* | 	test_path_is_missing git-bugreport-* | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'incorrect positional arguments abort with usage and hint' ' | test_expect_success 'incorrect positional arguments abort with usage and hint' ' | ||||||
| 	test_must_fail git bugreport false 2>output && | 	test_must_fail git bugreport false 2>output && | ||||||
| 	grep usage output && | 	test_grep usage output && | ||||||
| 	grep false output && | 	test_grep false output && | ||||||
| 	test_path_is_missing git-bugreport-* | 	test_path_is_missing git-bugreport-* | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  |  | ||||||
|  | @ -827,7 +827,7 @@ test_expect_success 'credential config with partial URLs' ' | ||||||
| 	git -c credential.$partial.helper=yep \ | 	git -c credential.$partial.helper=yep \ | ||||||
| 		-c credential.with%0anewline.username=uh-oh \ | 		-c credential.with%0anewline.username=uh-oh \ | ||||||
| 		credential fill <stdin 2>stderr && | 		credential fill <stdin 2>stderr && | ||||||
| 	test_i18ngrep "skipping credential lookup for key" stderr | 	test_grep "skipping credential lookup for key" stderr | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_done | test_done | ||||||
|  |  | ||||||
|  | @ -125,7 +125,7 @@ test_expect_success 'fetch into corrupted repo with index-pack' ' | ||||||
| 		cd bit-error-cp && | 		cd bit-error-cp && | ||||||
| 		test_must_fail git -c transfer.unpackLimit=1 \ | 		test_must_fail git -c transfer.unpackLimit=1 \ | ||||||
| 			fetch ../no-bit-error 2>stderr && | 			fetch ../no-bit-error 2>stderr && | ||||||
| 		test_i18ngrep ! -i collision stderr | 		test_grep ! -i collision stderr | ||||||
| 	) | 	) | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  |  | ||||||
|  | @ -47,7 +47,7 @@ test_expect_success 'setup' ' | ||||||
| test_expect_success 'git sparse-checkout list (not sparse)' ' | test_expect_success 'git sparse-checkout list (not sparse)' ' | ||||||
| 	test_must_fail git -C repo sparse-checkout list >list 2>err && | 	test_must_fail git -C repo sparse-checkout list >list 2>err && | ||||||
| 	test_must_be_empty list && | 	test_must_be_empty list && | ||||||
| 	test_i18ngrep "this worktree is not sparse" err | 	test_grep "this worktree is not sparse" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'git sparse-checkout list (not sparse)' ' | test_expect_success 'git sparse-checkout list (not sparse)' ' | ||||||
|  | @ -55,7 +55,7 @@ test_expect_success 'git sparse-checkout list (not sparse)' ' | ||||||
| 	rm repo/.git/info/sparse-checkout && | 	rm repo/.git/info/sparse-checkout && | ||||||
| 	git -C repo sparse-checkout list >list 2>err && | 	git -C repo sparse-checkout list >list 2>err && | ||||||
| 	test_must_be_empty list && | 	test_must_be_empty list && | ||||||
| 	test_i18ngrep "this worktree is not sparse (sparse-checkout file may not exist)" err | 	test_grep "this worktree is not sparse (sparse-checkout file may not exist)" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'git sparse-checkout list (populated)' ' | test_expect_success 'git sparse-checkout list (populated)' ' | ||||||
|  | @ -230,7 +230,7 @@ test_expect_success 'cone mode: match patterns' ' | ||||||
| 	git -C repo config --worktree core.sparseCheckoutCone true && | 	git -C repo config --worktree core.sparseCheckoutCone true && | ||||||
| 	rm -rf repo/a repo/folder1 repo/folder2 && | 	rm -rf repo/a repo/folder1 repo/folder2 && | ||||||
| 	git -C repo read-tree -mu HEAD 2>err && | 	git -C repo read-tree -mu HEAD 2>err && | ||||||
| 	test_i18ngrep ! "disabling cone patterns" err && | 	test_grep ! "disabling cone patterns" err && | ||||||
| 	git -C repo reset --hard && | 	git -C repo reset --hard && | ||||||
| 	check_files repo a folder1 folder2 | 	check_files repo a folder1 folder2 | ||||||
| ' | ' | ||||||
|  | @ -240,7 +240,7 @@ test_expect_success 'cone mode: warn on bad pattern' ' | ||||||
| 	cp repo/.git/info/sparse-checkout . && | 	cp repo/.git/info/sparse-checkout . && | ||||||
| 	echo "!/deep/deeper/*/" >>repo/.git/info/sparse-checkout && | 	echo "!/deep/deeper/*/" >>repo/.git/info/sparse-checkout && | ||||||
| 	git -C repo read-tree -mu HEAD 2>err && | 	git -C repo read-tree -mu HEAD 2>err && | ||||||
| 	test_i18ngrep "unrecognized negative pattern" err | 	test_grep "unrecognized negative pattern" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'sparse-checkout disable' ' | test_expect_success 'sparse-checkout disable' ' | ||||||
|  | @ -283,7 +283,7 @@ test_expect_success 'sparse-index enabled and disabled' ' | ||||||
| test_expect_success 'cone mode: init and set' ' | test_expect_success 'cone mode: init and set' ' | ||||||
| 	git -C repo sparse-checkout init --cone && | 	git -C repo sparse-checkout init --cone && | ||||||
| 	git -C repo config --list >config && | 	git -C repo config --list >config && | ||||||
| 	test_i18ngrep "core.sparsecheckoutcone=true" config && | 	test_grep "core.sparsecheckoutcone=true" config && | ||||||
| 	list_files repo >dir  && | 	list_files repo >dir  && | ||||||
| 	echo a >expect && | 	echo a >expect && | ||||||
| 	test_cmp expect dir && | 	test_cmp expect dir && | ||||||
|  | @ -386,7 +386,7 @@ test_expect_success 'not-up-to-date does not block rest of sparsification' ' | ||||||
|  |  | ||||||
| 	git -C repo sparse-checkout set deep/deeper1 2>err && | 	git -C repo sparse-checkout set deep/deeper1 2>err && | ||||||
|  |  | ||||||
| 	test_i18ngrep "The following paths are not up to date" err && | 	test_grep "The following paths are not up to date" err && | ||||||
| 	test_cmp expect repo/.git/info/sparse-checkout && | 	test_cmp expect repo/.git/info/sparse-checkout && | ||||||
| 	check_files repo/deep a deeper1 deeper2 && | 	check_files repo/deep a deeper1 deeper2 && | ||||||
| 	check_files repo/deep/deeper1 a deepest && | 	check_files repo/deep/deeper1 a deepest && | ||||||
|  | @ -401,8 +401,8 @@ test_expect_success 'revert to old sparse-checkout on empty update' ' | ||||||
| 		git add file && | 		git add file && | ||||||
| 		git commit -m "test" && | 		git commit -m "test" && | ||||||
| 		git sparse-checkout set nothing 2>err && | 		git sparse-checkout set nothing 2>err && | ||||||
| 		test_i18ngrep ! "Sparse checkout leaves no entry on working directory" err && | 		test_grep ! "Sparse checkout leaves no entry on working directory" err && | ||||||
| 		test_i18ngrep ! ".git/index.lock" err && | 		test_grep ! ".git/index.lock" err && | ||||||
| 		git sparse-checkout set --no-cone file | 		git sparse-checkout set --no-cone file | ||||||
| 	) | 	) | ||||||
| ' | ' | ||||||
|  | @ -411,14 +411,14 @@ test_expect_success 'fail when lock is taken' ' | ||||||
| 	test_when_finished rm -rf repo/.git/info/sparse-checkout.lock && | 	test_when_finished rm -rf repo/.git/info/sparse-checkout.lock && | ||||||
| 	touch repo/.git/info/sparse-checkout.lock && | 	touch repo/.git/info/sparse-checkout.lock && | ||||||
| 	test_must_fail git -C repo sparse-checkout set deep 2>err && | 	test_must_fail git -C repo sparse-checkout set deep 2>err && | ||||||
| 	test_i18ngrep "Unable to create .*\.lock" err | 	test_grep "Unable to create .*\.lock" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success '.gitignore should not warn about cone mode' ' | test_expect_success '.gitignore should not warn about cone mode' ' | ||||||
| 	git -C repo config --worktree core.sparseCheckoutCone true && | 	git -C repo config --worktree core.sparseCheckoutCone true && | ||||||
| 	echo "**/bin/*" >repo/.gitignore && | 	echo "**/bin/*" >repo/.gitignore && | ||||||
| 	git -C repo reset --hard 2>err && | 	git -C repo reset --hard 2>err && | ||||||
| 	test_i18ngrep ! "disabling cone patterns" err | 	test_grep ! "disabling cone patterns" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'sparse-checkout (init|set|disable) warns with dirty status' ' | test_expect_success 'sparse-checkout (init|set|disable) warns with dirty status' ' | ||||||
|  | @ -426,10 +426,10 @@ test_expect_success 'sparse-checkout (init|set|disable) warns with dirty status' | ||||||
| 	echo dirty >dirty/folder1/a && | 	echo dirty >dirty/folder1/a && | ||||||
|  |  | ||||||
| 	git -C dirty sparse-checkout init --no-cone 2>err && | 	git -C dirty sparse-checkout init --no-cone 2>err && | ||||||
| 	test_i18ngrep "warning.*The following paths are not up to date" err && | 	test_grep "warning.*The following paths are not up to date" err && | ||||||
|  |  | ||||||
| 	git -C dirty sparse-checkout set /folder2/* /deep/deeper1/* 2>err && | 	git -C dirty sparse-checkout set /folder2/* /deep/deeper1/* 2>err && | ||||||
| 	test_i18ngrep "warning.*The following paths are not up to date" err && | 	test_grep "warning.*The following paths are not up to date" err && | ||||||
| 	test_path_is_file dirty/folder1/a && | 	test_path_is_file dirty/folder1/a && | ||||||
|  |  | ||||||
| 	git -C dirty sparse-checkout disable 2>err && | 	git -C dirty sparse-checkout disable 2>err && | ||||||
|  | @ -453,14 +453,14 @@ test_expect_success 'sparse-checkout (init|set|disable) warns with unmerged stat | ||||||
| 	git -C unmerged update-index --index-info <input && | 	git -C unmerged update-index --index-info <input && | ||||||
|  |  | ||||||
| 	git -C unmerged sparse-checkout init --no-cone 2>err && | 	git -C unmerged sparse-checkout init --no-cone 2>err && | ||||||
| 	test_i18ngrep "warning.*The following paths are unmerged" err && | 	test_grep "warning.*The following paths are unmerged" err && | ||||||
|  |  | ||||||
| 	git -C unmerged sparse-checkout set /folder2/* /deep/deeper1/* 2>err && | 	git -C unmerged sparse-checkout set /folder2/* /deep/deeper1/* 2>err && | ||||||
| 	test_i18ngrep "warning.*The following paths are unmerged" err && | 	test_grep "warning.*The following paths are unmerged" err && | ||||||
| 	test_path_is_file dirty/folder1/a && | 	test_path_is_file dirty/folder1/a && | ||||||
|  |  | ||||||
| 	git -C unmerged sparse-checkout disable 2>err && | 	git -C unmerged sparse-checkout disable 2>err && | ||||||
| 	test_i18ngrep "warning.*The following paths are unmerged" err && | 	test_grep "warning.*The following paths are unmerged" err && | ||||||
|  |  | ||||||
| 	git -C unmerged reset --hard && | 	git -C unmerged reset --hard && | ||||||
| 	git -C unmerged sparse-checkout init --no-cone && | 	git -C unmerged sparse-checkout init --no-cone && | ||||||
|  | @ -480,24 +480,24 @@ test_expect_failure 'sparse-checkout reapply' ' | ||||||
| 	git -C tweak update-index --index-info <input && | 	git -C tweak update-index --index-info <input && | ||||||
|  |  | ||||||
| 	git -C tweak sparse-checkout init --cone 2>err && | 	git -C tweak sparse-checkout init --cone 2>err && | ||||||
| 	test_i18ngrep "warning.*The following paths are not up to date" err && | 	test_grep "warning.*The following paths are not up to date" err && | ||||||
| 	test_i18ngrep "warning.*The following paths are unmerged" err && | 	test_grep "warning.*The following paths are unmerged" err && | ||||||
|  |  | ||||||
| 	git -C tweak sparse-checkout set folder2 deep/deeper1 2>err && | 	git -C tweak sparse-checkout set folder2 deep/deeper1 2>err && | ||||||
| 	test_i18ngrep "warning.*The following paths are not up to date" err && | 	test_grep "warning.*The following paths are not up to date" err && | ||||||
| 	test_i18ngrep "warning.*The following paths are unmerged" err && | 	test_grep "warning.*The following paths are unmerged" err && | ||||||
|  |  | ||||||
| 	git -C tweak sparse-checkout reapply 2>err && | 	git -C tweak sparse-checkout reapply 2>err && | ||||||
| 	test_i18ngrep "warning.*The following paths are not up to date" err && | 	test_grep "warning.*The following paths are not up to date" err && | ||||||
| 	test_path_is_file tweak/deep/deeper2/a && | 	test_path_is_file tweak/deep/deeper2/a && | ||||||
| 	test_i18ngrep "warning.*The following paths are unmerged" err && | 	test_grep "warning.*The following paths are unmerged" err && | ||||||
| 	test_path_is_file tweak/folder1/a && | 	test_path_is_file tweak/folder1/a && | ||||||
|  |  | ||||||
| 	git -C tweak checkout HEAD deep/deeper2/a && | 	git -C tweak checkout HEAD deep/deeper2/a && | ||||||
| 	git -C tweak sparse-checkout reapply 2>err && | 	git -C tweak sparse-checkout reapply 2>err && | ||||||
| 	test_i18ngrep ! "warning.*The following paths are not up to date" err && | 	test_grep ! "warning.*The following paths are not up to date" err && | ||||||
| 	test_path_is_missing tweak/deep/deeper2/a && | 	test_path_is_missing tweak/deep/deeper2/a && | ||||||
| 	test_i18ngrep "warning.*The following paths are unmerged" err && | 	test_grep "warning.*The following paths are unmerged" err && | ||||||
| 	test_path_is_file tweak/folder1/a && | 	test_path_is_file tweak/folder1/a && | ||||||
|  |  | ||||||
| 	# NEEDSWORK: We are asking to update a file outside of the | 	# NEEDSWORK: We are asking to update a file outside of the | ||||||
|  | @ -578,8 +578,8 @@ test_expect_success 'check-rules interaction with submodules' ' | ||||||
| 	git -C super ls-tree --name-only -r HEAD >all-files && | 	git -C super ls-tree --name-only -r HEAD >all-files && | ||||||
| 	git -C super sparse-checkout check-rules >check-rules-matches <all-files && | 	git -C super sparse-checkout check-rules >check-rules-matches <all-files && | ||||||
|  |  | ||||||
| 	test_i18ngrep ! "modules/" check-rules-matches && | 	test_grep ! "modules/" check-rules-matches && | ||||||
| 	test_i18ngrep "folder1/" check-rules-matches | 	test_grep "folder1/" check-rules-matches | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'different sparse-checkouts with worktrees' ' | test_expect_success 'different sparse-checkouts with worktrees' ' | ||||||
|  | @ -616,7 +616,7 @@ check_read_tree_errors () { | ||||||
| 	then | 	then | ||||||
| 		test_must_be_empty err | 		test_must_be_empty err | ||||||
| 	else | 	else | ||||||
| 		test_i18ngrep "$ERRORS" err | 		test_grep "$ERRORS" err | ||||||
| 	fi && | 	fi && | ||||||
| 	check_files $REPO $FILES | 	check_files $REPO $FILES | ||||||
| } | } | ||||||
|  | @ -898,32 +898,32 @@ test_expect_success 'setup bare repo' ' | ||||||
| ' | ' | ||||||
| test_expect_success 'list fails outside work tree' ' | test_expect_success 'list fails outside work tree' ' | ||||||
| 	test_must_fail git -C bare sparse-checkout list 2>err && | 	test_must_fail git -C bare sparse-checkout list 2>err && | ||||||
| 	test_i18ngrep "this operation must be run in a work tree" err | 	test_grep "this operation must be run in a work tree" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'add fails outside work tree' ' | test_expect_success 'add fails outside work tree' ' | ||||||
| 	test_must_fail git -C bare sparse-checkout add deeper 2>err && | 	test_must_fail git -C bare sparse-checkout add deeper 2>err && | ||||||
| 	test_i18ngrep "this operation must be run in a work tree" err | 	test_grep "this operation must be run in a work tree" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'set fails outside work tree' ' | test_expect_success 'set fails outside work tree' ' | ||||||
| 	test_must_fail git -C bare sparse-checkout set deeper 2>err && | 	test_must_fail git -C bare sparse-checkout set deeper 2>err && | ||||||
| 	test_i18ngrep "this operation must be run in a work tree" err | 	test_grep "this operation must be run in a work tree" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'init fails outside work tree' ' | test_expect_success 'init fails outside work tree' ' | ||||||
| 	test_must_fail git -C bare sparse-checkout init 2>err && | 	test_must_fail git -C bare sparse-checkout init 2>err && | ||||||
| 	test_i18ngrep "this operation must be run in a work tree" err | 	test_grep "this operation must be run in a work tree" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'reapply fails outside work tree' ' | test_expect_success 'reapply fails outside work tree' ' | ||||||
| 	test_must_fail git -C bare sparse-checkout reapply 2>err && | 	test_must_fail git -C bare sparse-checkout reapply 2>err && | ||||||
| 	test_i18ngrep "this operation must be run in a work tree" err | 	test_grep "this operation must be run in a work tree" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'disable fails outside work tree' ' | test_expect_success 'disable fails outside work tree' ' | ||||||
| 	test_must_fail git -C bare sparse-checkout disable 2>err && | 	test_must_fail git -C bare sparse-checkout disable 2>err && | ||||||
| 	test_i18ngrep "this operation must be run in a work tree" err | 	test_grep "this operation must be run in a work tree" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'setup clean' ' | test_expect_success 'setup clean' ' | ||||||
|  | @ -946,8 +946,8 @@ test_expect_success 'check-rules cone mode' ' | ||||||
|  |  | ||||||
| 	git -C repo sparse-checkout check-rules >check-rules-default <all-files && | 	git -C repo sparse-checkout check-rules >check-rules-default <all-files && | ||||||
|  |  | ||||||
| 	test_i18ngrep "deep/deeper1/deepest/a" check-rules-file && | 	test_grep "deep/deeper1/deepest/a" check-rules-file && | ||||||
| 	test_i18ngrep ! "deep/deeper2" check-rules-file && | 	test_grep ! "deep/deeper2" check-rules-file && | ||||||
|  |  | ||||||
| 	test_cmp check-rules-file ls-files && | 	test_cmp check-rules-file ls-files && | ||||||
| 	test_cmp check-rules-file check-rules-default | 	test_cmp check-rules-file check-rules-default | ||||||
|  |  | ||||||
|  | @ -337,8 +337,8 @@ test_expect_success 'status reports sparse-checkout' ' | ||||||
| 	init_repos && | 	init_repos && | ||||||
| 	git -C sparse-checkout status >full && | 	git -C sparse-checkout status >full && | ||||||
| 	git -C sparse-index status >sparse && | 	git -C sparse-index status >sparse && | ||||||
| 	test_i18ngrep "You are in a sparse checkout with " full && | 	test_grep "You are in a sparse checkout with " full && | ||||||
| 	test_i18ngrep "You are in a sparse checkout." sparse | 	test_grep "You are in a sparse checkout." sparse | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'add, commit, checkout' ' | test_expect_success 'add, commit, checkout' ' | ||||||
|  | @ -1182,7 +1182,7 @@ test_expect_success 'checkout-index outside sparse definition' ' | ||||||
| 	# Without --ignore-skip-worktree-bits, outside-of-cone files will trigger | 	# Without --ignore-skip-worktree-bits, outside-of-cone files will trigger | ||||||
| 	# an error | 	# an error | ||||||
| 	test_sparse_match test_must_fail git checkout-index -- folder1/a && | 	test_sparse_match test_must_fail git checkout-index -- folder1/a && | ||||||
| 	test_i18ngrep "folder1/a has skip-worktree enabled" sparse-checkout-err && | 	test_grep "folder1/a has skip-worktree enabled" sparse-checkout-err && | ||||||
| 	test_path_is_missing folder1/a && | 	test_path_is_missing folder1/a && | ||||||
|  |  | ||||||
| 	# With --ignore-skip-worktree-bits, outside-of-cone files are checked out | 	# With --ignore-skip-worktree-bits, outside-of-cone files are checked out | ||||||
|  |  | ||||||
|  | @ -453,7 +453,7 @@ test_expect_success 'get bool variable with empty value' ' | ||||||
|  |  | ||||||
| test_expect_success 'no arguments, but no crash' ' | test_expect_success 'no arguments, but no crash' ' | ||||||
| 	test_must_fail git config >output 2>&1 && | 	test_must_fail git config >output 2>&1 && | ||||||
| 	test_i18ngrep usage output | 	test_grep usage output | ||||||
| ' | ' | ||||||
|  |  | ||||||
| cat > .git/config << EOF | cat > .git/config << EOF | ||||||
|  | @ -720,25 +720,25 @@ test_expect_success 'invalid unit' ' | ||||||
| 	git config aninvalid.unit "1auto" && | 	git config aninvalid.unit "1auto" && | ||||||
| 	test_cmp_config 1auto aninvalid.unit && | 	test_cmp_config 1auto aninvalid.unit && | ||||||
| 	test_must_fail git config --int --get aninvalid.unit 2>actual && | 	test_must_fail git config --int --get aninvalid.unit 2>actual && | ||||||
| 	test_i18ngrep "bad numeric config value .1auto. for .aninvalid.unit. in file .git/config: invalid unit" actual | 	test_grep "bad numeric config value .1auto. for .aninvalid.unit. in file .git/config: invalid unit" actual | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'invalid unit boolean' ' | test_expect_success 'invalid unit boolean' ' | ||||||
| 	git config commit.gpgsign "1true" && | 	git config commit.gpgsign "1true" && | ||||||
| 	test_cmp_config 1true commit.gpgsign && | 	test_cmp_config 1true commit.gpgsign && | ||||||
| 	test_must_fail git config --bool --get commit.gpgsign 2>actual && | 	test_must_fail git config --bool --get commit.gpgsign 2>actual && | ||||||
| 	test_i18ngrep "bad boolean config value .1true. for .commit.gpgsign." actual | 	test_grep "bad boolean config value .1true. for .commit.gpgsign." actual | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'line number is reported correctly' ' | test_expect_success 'line number is reported correctly' ' | ||||||
| 	printf "[bool]\n\tvar\n" >invalid && | 	printf "[bool]\n\tvar\n" >invalid && | ||||||
| 	test_must_fail git config -f invalid --path bool.var 2>actual && | 	test_must_fail git config -f invalid --path bool.var 2>actual && | ||||||
| 	test_i18ngrep "line 2" actual | 	test_grep "line 2" actual | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'invalid stdin config' ' | test_expect_success 'invalid stdin config' ' | ||||||
| 	echo "[broken" | test_must_fail git config --list --file - >output 2>&1 && | 	echo "[broken" | test_must_fail git config --list --file - >output 2>&1 && | ||||||
| 	test_i18ngrep "bad config line 1 in standard input" output | 	test_grep "bad config line 1 in standard input" output | ||||||
| ' | ' | ||||||
|  |  | ||||||
| cat > expect << EOF | cat > expect << EOF | ||||||
|  | @ -919,7 +919,7 @@ test_expect_success !MINGW 'get --path copes with unset $HOME' ' | ||||||
| 		git config --get --path path.normal >>result && | 		git config --get --path path.normal >>result && | ||||||
| 		git config --get --path path.trailingtilde >>result | 		git config --get --path path.trailingtilde >>result | ||||||
| 	) && | 	) && | ||||||
| 	test_i18ngrep "[Ff]ailed to expand.*~/" msg && | 	test_grep "[Ff]ailed to expand.*~/" msg && | ||||||
| 	test_cmp expect result | 	test_cmp expect result | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  | @ -986,7 +986,7 @@ test_expect_success 'get --type=color barfs on non-color' ' | ||||||
|  |  | ||||||
| test_expect_success 'set --type=color barfs on non-color' ' | test_expect_success 'set --type=color barfs on non-color' ' | ||||||
| 	test_must_fail git config --type=color foo.color "not-a-color" 2>error && | 	test_must_fail git config --type=color foo.color "not-a-color" 2>error && | ||||||
| 	test_i18ngrep "cannot parse color" error | 	test_grep "cannot parse color" error | ||||||
| ' | ' | ||||||
|  |  | ||||||
| cat > expect << EOF | cat > expect << EOF | ||||||
|  | @ -1447,12 +1447,12 @@ test_expect_success 'git --config-env with missing value' ' | ||||||
|  |  | ||||||
| test_expect_success 'git --config-env fails with invalid parameters' ' | test_expect_success 'git --config-env fails with invalid parameters' ' | ||||||
| 	test_must_fail git --config-env=foo.flag config --bool foo.flag 2>error && | 	test_must_fail git --config-env=foo.flag config --bool foo.flag 2>error && | ||||||
| 	test_i18ngrep "invalid config format: foo.flag" error && | 	test_grep "invalid config format: foo.flag" error && | ||||||
| 	test_must_fail git --config-env=foo.flag= config --bool foo.flag 2>error && | 	test_must_fail git --config-env=foo.flag= config --bool foo.flag 2>error && | ||||||
| 	test_i18ngrep "missing environment variable name for configuration ${SQ}foo.flag${SQ}" error && | 	test_grep "missing environment variable name for configuration ${SQ}foo.flag${SQ}" error && | ||||||
| 	sane_unset NONEXISTENT && | 	sane_unset NONEXISTENT && | ||||||
| 	test_must_fail git --config-env=foo.flag=NONEXISTENT config --bool foo.flag 2>error && | 	test_must_fail git --config-env=foo.flag=NONEXISTENT config --bool foo.flag 2>error && | ||||||
| 	test_i18ngrep "missing environment variable ${SQ}NONEXISTENT${SQ} for configuration ${SQ}foo.flag${SQ}" error | 	test_grep "missing environment variable ${SQ}NONEXISTENT${SQ} for configuration ${SQ}foo.flag${SQ}" error | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'git -c and --config-env work together' ' | test_expect_success 'git -c and --config-env work together' ' | ||||||
|  | @ -1533,21 +1533,21 @@ test_expect_success 'git config ignores pairs with empty count' ' | ||||||
|  |  | ||||||
| test_expect_success 'git config fails with invalid count' ' | test_expect_success 'git config fails with invalid count' ' | ||||||
| 	test_must_fail env GIT_CONFIG_COUNT=10a git config --list 2>error && | 	test_must_fail env GIT_CONFIG_COUNT=10a git config --list 2>error && | ||||||
| 	test_i18ngrep "bogus count" error && | 	test_grep "bogus count" error && | ||||||
| 	test_must_fail env GIT_CONFIG_COUNT=9999999999999999 git config --list 2>error && | 	test_must_fail env GIT_CONFIG_COUNT=9999999999999999 git config --list 2>error && | ||||||
| 	test_i18ngrep "too many entries" error | 	test_grep "too many entries" error | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'git config fails with missing config key' ' | test_expect_success 'git config fails with missing config key' ' | ||||||
| 	test_must_fail env GIT_CONFIG_COUNT=1 GIT_CONFIG_VALUE_0="value" \ | 	test_must_fail env GIT_CONFIG_COUNT=1 GIT_CONFIG_VALUE_0="value" \ | ||||||
| 		git config --list 2>error && | 		git config --list 2>error && | ||||||
| 	test_i18ngrep "missing config key" error | 	test_grep "missing config key" error | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'git config fails with missing config value' ' | test_expect_success 'git config fails with missing config value' ' | ||||||
| 	test_must_fail env GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0="pair.one" \ | 	test_must_fail env GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0="pair.one" \ | ||||||
| 		git config --list 2>error && | 		git config --list 2>error && | ||||||
| 	test_i18ngrep "missing config value" error | 	test_grep "missing config value" error | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'git config fails with invalid config pair key' ' | test_expect_success 'git config fails with invalid config pair key' ' | ||||||
|  | @ -1617,7 +1617,7 @@ test_expect_success 'barf on syntax error' ' | ||||||
| 	key garbage | 	key garbage | ||||||
| 	EOF | 	EOF | ||||||
| 	test_must_fail git config --get section.key 2>error && | 	test_must_fail git config --get section.key 2>error && | ||||||
| 	test_i18ngrep " line 3 " error | 	test_grep " line 3 " error | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'barf on incomplete section header' ' | test_expect_success 'barf on incomplete section header' ' | ||||||
|  | @ -1627,7 +1627,7 @@ test_expect_success 'barf on incomplete section header' ' | ||||||
| 	key = value | 	key = value | ||||||
| 	EOF | 	EOF | ||||||
| 	test_must_fail git config --get section.key 2>error && | 	test_must_fail git config --get section.key 2>error && | ||||||
| 	test_i18ngrep " line 2 " error | 	test_grep " line 2 " error | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'barf on incomplete string' ' | test_expect_success 'barf on incomplete string' ' | ||||||
|  | @ -1637,7 +1637,7 @@ test_expect_success 'barf on incomplete string' ' | ||||||
| 	key = "value string | 	key = "value string | ||||||
| 	EOF | 	EOF | ||||||
| 	test_must_fail git config --get section.key 2>error && | 	test_must_fail git config --get section.key 2>error && | ||||||
| 	test_i18ngrep " line 3 " error | 	test_grep " line 3 " error | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'urlmatch' ' | test_expect_success 'urlmatch' ' | ||||||
|  | @ -2266,17 +2266,17 @@ test_expect_success 'identical mixed --type specifiers are allowed' ' | ||||||
|  |  | ||||||
| test_expect_success 'non-identical modern --type specifiers are not allowed' ' | test_expect_success 'non-identical modern --type specifiers are not allowed' ' | ||||||
| 	test_must_fail git config --type=int --type=bool section.big 2>error && | 	test_must_fail git config --type=int --type=bool section.big 2>error && | ||||||
| 	test_i18ngrep "only one type at a time" error | 	test_grep "only one type at a time" error | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'non-identical legacy --type specifiers are not allowed' ' | test_expect_success 'non-identical legacy --type specifiers are not allowed' ' | ||||||
| 	test_must_fail git config --int --bool section.big 2>error && | 	test_must_fail git config --int --bool section.big 2>error && | ||||||
| 	test_i18ngrep "only one type at a time" error | 	test_grep "only one type at a time" error | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'non-identical mixed --type specifiers are not allowed' ' | test_expect_success 'non-identical mixed --type specifiers are not allowed' ' | ||||||
| 	test_must_fail git config --type=int --bool section.big 2>error && | 	test_must_fail git config --type=int --bool section.big 2>error && | ||||||
| 	test_i18ngrep "only one type at a time" error | 	test_grep "only one type at a time" error | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success '--type allows valid type specifiers' ' | test_expect_success '--type allows valid type specifiers' ' | ||||||
|  | @ -2293,7 +2293,7 @@ test_expect_success 'unset type specifiers may be reset to conflicting ones' ' | ||||||
|  |  | ||||||
| test_expect_success '--type rejects unknown specifiers' ' | test_expect_success '--type rejects unknown specifiers' ' | ||||||
| 	test_must_fail git config --type=nonsense section.foo 2>error && | 	test_must_fail git config --type=nonsense section.foo 2>error && | ||||||
| 	test_i18ngrep "unrecognized --type argument" error | 	test_grep "unrecognized --type argument" error | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success '--type=int requires at least one digit' ' | test_expect_success '--type=int requires at least one digit' ' | ||||||
|  | @ -2339,7 +2339,7 @@ test_expect_success 'set all config with value-pattern' ' | ||||||
|  |  | ||||||
| 	# multiple matches => failure | 	# multiple matches => failure | ||||||
| 	test_must_fail git config --file=config abc.key three o+ 2>err && | 	test_must_fail git config --file=config abc.key three o+ 2>err && | ||||||
| 	test_i18ngrep "has multiple values" err && | 	test_grep "has multiple values" err && | ||||||
|  |  | ||||||
| 	# multiple values, no match => add | 	# multiple values, no match => add | ||||||
| 	git config --file=config abc.key three a+ && | 	git config --file=config abc.key three a+ && | ||||||
|  |  | ||||||
|  | @ -63,7 +63,7 @@ test_expect_success 'parse errors in blobs are properly attributed' ' | ||||||
| 	git commit -m broken && | 	git commit -m broken && | ||||||
|  |  | ||||||
| 	test_must_fail git config --blob=HEAD:config some.value 2>err && | 	test_must_fail git config --blob=HEAD:config some.value 2>err && | ||||||
| 	test_i18ngrep "HEAD:config" err | 	test_grep "HEAD:config" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'can parse blob ending with CR' ' | test_expect_success 'can parse blob ending with CR' ' | ||||||
|  |  | ||||||
|  | @ -172,7 +172,7 @@ test_expect_success 'find string value for a key' ' | ||||||
|  |  | ||||||
| test_expect_success 'check line error when NULL string is queried' ' | test_expect_success 'check line error when NULL string is queried' ' | ||||||
| 	test_expect_code 128 test-tool config get_string case.foo 2>result && | 	test_expect_code 128 test-tool config get_string case.foo 2>result && | ||||||
| 	test_i18ngrep "fatal: .*case\.foo.*\.git/config.*line 7" result | 	test_grep "fatal: .*case\.foo.*\.git/config.*line 7" result | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'find integer if value is non parse-able' ' | test_expect_success 'find integer if value is non parse-able' ' | ||||||
|  | @ -342,14 +342,14 @@ test_expect_success 'check line errors for malformed values' ' | ||||||
| 		br | 		br | ||||||
| 	EOF | 	EOF | ||||||
| 	test_expect_code 128 git br 2>result && | 	test_expect_code 128 git br 2>result && | ||||||
| 	test_i18ngrep "missing value for .alias\.br" result && | 	test_grep "missing value for .alias\.br" result && | ||||||
| 	test_i18ngrep "fatal: .*\.git/config" result && | 	test_grep "fatal: .*\.git/config" result && | ||||||
| 	test_i18ngrep "fatal: .*line 2" result | 	test_grep "fatal: .*line 2" result | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'error on modifying repo config without repo' ' | test_expect_success 'error on modifying repo config without repo' ' | ||||||
| 	nongit test_must_fail git config a.b c 2>err && | 	nongit test_must_fail git config a.b c 2>err && | ||||||
| 	test_i18ngrep "not in a git directory" err | 	test_grep "not in a git directory" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| cmdline_config="'foo.bar=from-cmdline'" | cmdline_config="'foo.bar=from-cmdline'" | ||||||
|  |  | ||||||
|  | @ -78,7 +78,7 @@ test_with_config () { | ||||||
|  |  | ||||||
| test_expect_success 'ignore .git/ with incompatible repository version' ' | test_expect_success 'ignore .git/ with incompatible repository version' ' | ||||||
| 	test_with_config "[core]repositoryformatversion = 999999" 2>err && | 	test_with_config "[core]repositoryformatversion = 999999" 2>err && | ||||||
| 	test_i18ngrep "warning:.* Expected git repo version <= [1-9]" err | 	test_grep "warning:.* Expected git repo version <= [1-9]" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_failure 'ignore .git/ with invalid repository version' ' | test_expect_failure 'ignore .git/ with invalid repository version' ' | ||||||
|  |  | ||||||
|  | @ -26,12 +26,12 @@ test_expect_success 'canonicalizes --default with appropriate type' ' | ||||||
| test_expect_success 'dies when --default cannot be parsed' ' | test_expect_success 'dies when --default cannot be parsed' ' | ||||||
| 	test_must_fail git config -f config --type=expiry-date --default=x --get \ | 	test_must_fail git config -f config --type=expiry-date --default=x --get \ | ||||||
| 		not.a.section 2>error && | 		not.a.section 2>error && | ||||||
| 	test_i18ngrep "failed to format default config value" error | 	test_grep "failed to format default config value" error | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'does not allow --default without --get' ' | test_expect_success 'does not allow --default without --get' ' | ||||||
| 	test_must_fail git config --default=quux --unset a.section >output 2>&1 && | 	test_must_fail git config --default=quux --unset a.section >output 2>&1 && | ||||||
| 	test_i18ngrep "\-\-default is only applicable to" output | 	test_grep "\-\-default is only applicable to" output | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_done | test_done | ||||||
|  |  | ||||||
|  | @ -410,7 +410,7 @@ test_expect_success 'Query "main@{2005-05-26 23:33:01}" (middle of history with | ||||||
| 	git rev-parse --verify "main@{2005-05-26 23:33:01}" >o 2>e && | 	git rev-parse --verify "main@{2005-05-26 23:33:01}" >o 2>e && | ||||||
| 	echo "$B" >expect && | 	echo "$B" >expect && | ||||||
| 	test_cmp expect o && | 	test_cmp expect o && | ||||||
| 	test_i18ngrep -F "warning: log for ref $m has gap after $gd" e | 	test_grep -F "warning: log for ref $m has gap after $gd" e | ||||||
| ' | ' | ||||||
| test_expect_success 'Query "main@{2005-05-26 23:38:00}" (middle of history)' ' | test_expect_success 'Query "main@{2005-05-26 23:38:00}" (middle of history)' ' | ||||||
| 	test_when_finished "rm -f o e" && | 	test_when_finished "rm -f o e" && | ||||||
|  | @ -431,7 +431,7 @@ test_expect_success 'Query "main@{2005-05-28}" (past end of history)' ' | ||||||
| 	git rev-parse --verify "main@{2005-05-28}" >o 2>e && | 	git rev-parse --verify "main@{2005-05-28}" >o 2>e && | ||||||
| 	echo "$D" >expect && | 	echo "$D" >expect && | ||||||
| 	test_cmp expect o && | 	test_cmp expect o && | ||||||
| 	test_i18ngrep -F "warning: log for ref $m unexpectedly ended on $ld" e | 	test_grep -F "warning: log for ref $m unexpectedly ended on $ld" e | ||||||
| ' | ' | ||||||
|  |  | ||||||
| rm -f .git/$m .git/logs/$m expect | rm -f .git/$m .git/logs/$m expect | ||||||
|  | @ -486,7 +486,7 @@ test_expect_success 'git cat-file blob main@{2005-05-26 23:42}:F (expect OTHER)' | ||||||
| test_expect_success 'given old value for missing pseudoref, do not create' ' | test_expect_success 'given old value for missing pseudoref, do not create' ' | ||||||
| 	test_must_fail git update-ref PSEUDOREF $A $B 2>err && | 	test_must_fail git update-ref PSEUDOREF $A $B 2>err && | ||||||
| 	test_must_fail git rev-parse PSEUDOREF && | 	test_must_fail git rev-parse PSEUDOREF && | ||||||
| 	test_i18ngrep "unable to resolve reference" err | 	test_grep "unable to resolve reference" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'create pseudoref' ' | test_expect_success 'create pseudoref' ' | ||||||
|  | @ -507,7 +507,7 @@ test_expect_success 'overwrite pseudoref with correct old value' ' | ||||||
| test_expect_success 'do not overwrite pseudoref with wrong old value' ' | test_expect_success 'do not overwrite pseudoref with wrong old value' ' | ||||||
| 	test_must_fail git update-ref PSEUDOREF $D $E 2>err && | 	test_must_fail git update-ref PSEUDOREF $D $E 2>err && | ||||||
| 	test $C = $(git rev-parse PSEUDOREF) && | 	test $C = $(git rev-parse PSEUDOREF) && | ||||||
| 	test_i18ngrep "cannot lock ref.*expected" err | 	test_grep "cannot lock ref.*expected" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'delete pseudoref' ' | test_expect_success 'delete pseudoref' ' | ||||||
|  | @ -519,7 +519,7 @@ test_expect_success 'do not delete pseudoref with wrong old value' ' | ||||||
| 	git update-ref PSEUDOREF $A && | 	git update-ref PSEUDOREF $A && | ||||||
| 	test_must_fail git update-ref -d PSEUDOREF $B 2>err && | 	test_must_fail git update-ref -d PSEUDOREF $B 2>err && | ||||||
| 	test $A = $(git rev-parse PSEUDOREF) && | 	test $A = $(git rev-parse PSEUDOREF) && | ||||||
| 	test_i18ngrep "cannot lock ref.*expected" err | 	test_grep "cannot lock ref.*expected" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'delete pseudoref with correct old value' ' | test_expect_success 'delete pseudoref with correct old value' ' | ||||||
|  | @ -536,7 +536,7 @@ test_expect_success 'do not overwrite pseudoref with old OID zero' ' | ||||||
| 	test_when_finished git update-ref -d PSEUDOREF && | 	test_when_finished git update-ref -d PSEUDOREF && | ||||||
| 	test_must_fail git update-ref PSEUDOREF $B $Z 2>err && | 	test_must_fail git update-ref PSEUDOREF $B $Z 2>err && | ||||||
| 	test $A = $(git rev-parse PSEUDOREF) && | 	test $A = $(git rev-parse PSEUDOREF) && | ||||||
| 	test_i18ngrep "already exists" err | 	test_grep "already exists" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| # Test --stdin | # Test --stdin | ||||||
|  | @ -556,7 +556,7 @@ test_expect_success 'stdin test setup' ' | ||||||
|  |  | ||||||
| test_expect_success '-z fails without --stdin' ' | test_expect_success '-z fails without --stdin' ' | ||||||
| 	test_must_fail git update-ref -z $m $m $m 2>err && | 	test_must_fail git update-ref -z $m $m $m 2>err && | ||||||
| 	test_i18ngrep "usage: git update-ref" err | 	test_grep "usage: git update-ref" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'stdin works with no input' ' | test_expect_success 'stdin works with no input' ' | ||||||
|  | @ -674,7 +674,7 @@ test_expect_success 'stdin fails with duplicate refs' ' | ||||||
| 	create $a $m | 	create $a $m | ||||||
| 	EOF | 	EOF | ||||||
| 	test_must_fail git update-ref --stdin <stdin 2>err && | 	test_must_fail git update-ref --stdin <stdin 2>err && | ||||||
| 	test_i18ngrep "fatal: multiple updates for ref '"'"'$a'"'"' not allowed" err | 	test_grep "fatal: multiple updates for ref '"'"'$a'"'"' not allowed" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'stdin create ref works' ' | test_expect_success 'stdin create ref works' ' | ||||||
|  | @ -1107,7 +1107,7 @@ test_expect_success 'stdin -z fails option with unknown name' ' | ||||||
| test_expect_success 'stdin -z fails with duplicate refs' ' | test_expect_success 'stdin -z fails with duplicate refs' ' | ||||||
| 	printf $F "create $a" "$m" "create $b" "$m" "create $a" "$m" >stdin && | 	printf $F "create $a" "$m" "create $b" "$m" "create $a" "$m" >stdin && | ||||||
| 	test_must_fail git update-ref -z --stdin <stdin 2>err && | 	test_must_fail git update-ref -z --stdin <stdin 2>err && | ||||||
| 	test_i18ngrep "fatal: multiple updates for ref '"'"'$a'"'"' not allowed" err | 	test_grep "fatal: multiple updates for ref '"'"'$a'"'"' not allowed" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'stdin -z create ref works' ' | test_expect_success 'stdin -z create ref works' ' | ||||||
|  | @ -1338,7 +1338,7 @@ test_expect_success 'fails with duplicate HEAD update' ' | ||||||
| 	update HEAD $B | 	update HEAD $B | ||||||
| 	EOF | 	EOF | ||||||
| 	test_must_fail git update-ref --stdin <stdin 2>err && | 	test_must_fail git update-ref --stdin <stdin 2>err && | ||||||
| 	test_i18ngrep "fatal: multiple updates for '\''HEAD'\'' (including one via its referent .refs/heads/target1.) are not allowed" err && | 	test_grep "fatal: multiple updates for '\''HEAD'\'' (including one via its referent .refs/heads/target1.) are not allowed" err && | ||||||
| 	echo "refs/heads/target1" >expect && | 	echo "refs/heads/target1" >expect && | ||||||
| 	git symbolic-ref HEAD >actual && | 	git symbolic-ref HEAD >actual && | ||||||
| 	test_cmp expect actual && | 	test_cmp expect actual && | ||||||
|  | @ -1355,7 +1355,7 @@ test_expect_success 'fails with duplicate ref update via symref' ' | ||||||
| 	update refs/heads/symref2 $B | 	update refs/heads/symref2 $B | ||||||
| 	EOF | 	EOF | ||||||
| 	test_must_fail git update-ref --stdin <stdin 2>err && | 	test_must_fail git update-ref --stdin <stdin 2>err && | ||||||
| 	test_i18ngrep "fatal: multiple updates for '\''refs/heads/target2'\'' (including one via symref .refs/heads/symref2.) are not allowed" err && | 	test_grep "fatal: multiple updates for '\''refs/heads/target2'\'' (including one via symref .refs/heads/symref2.) are not allowed" err && | ||||||
| 	echo "refs/heads/target2" >expect && | 	echo "refs/heads/target2" >expect && | ||||||
| 	git symbolic-ref refs/heads/symref2 >actual && | 	git symbolic-ref refs/heads/symref2 >actual && | ||||||
| 	test_cmp expect actual && | 	test_cmp expect actual && | ||||||
|  |  | ||||||
|  | @ -29,7 +29,7 @@ test_update_rejected () { | ||||||
| 	fi && | 	fi && | ||||||
| 	printf "create $prefix/%s $C\n" $create >input && | 	printf "create $prefix/%s $C\n" $create >input && | ||||||
| 	test_must_fail git update-ref --stdin <input 2>output.err && | 	test_must_fail git update-ref --stdin <input 2>output.err && | ||||||
| 	test_i18ngrep -F "$error" output.err && | 	test_grep -F "$error" output.err && | ||||||
| 	git for-each-ref $prefix >actual && | 	git for-each-ref $prefix >actual && | ||||||
| 	test_cmp unchanged actual | 	test_cmp unchanged actual | ||||||
| } | } | ||||||
|  | @ -613,7 +613,7 @@ test_expect_success REFFILES 'delete fails cleanly if packed-refs file is locked | ||||||
| 	test_when_finished "rm -f .git/packed-refs.lock" && | 	test_when_finished "rm -f .git/packed-refs.lock" && | ||||||
| 	test_must_fail git update-ref -d $prefix/foo >out 2>err && | 	test_must_fail git update-ref -d $prefix/foo >out 2>err && | ||||||
| 	git for-each-ref $prefix >actual && | 	git for-each-ref $prefix >actual && | ||||||
| 	test_i18ngrep "Unable to create $SQ.*packed-refs.lock$SQ: " err && | 	test_grep "Unable to create $SQ.*packed-refs.lock$SQ: " err && | ||||||
| 	test_cmp unchanged actual | 	test_cmp unchanged actual | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  |  | ||||||
|  | @ -29,7 +29,7 @@ check_fsck () { | ||||||
| 	'') | 	'') | ||||||
| 		test_must_be_empty fsck.output ;; | 		test_must_be_empty fsck.output ;; | ||||||
| 	*) | 	*) | ||||||
| 		test_i18ngrep "$1" fsck.output ;; | 		test_grep "$1" fsck.output ;; | ||||||
| 	esac | 	esac | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -308,9 +308,9 @@ test_expect_success 'git reflog expire unknown reference' ' | ||||||
| 	test_config gc.reflogexpireunreachable never && | 	test_config gc.reflogexpireunreachable never && | ||||||
|  |  | ||||||
| 	test_must_fail git reflog expire main@{123} 2>stderr && | 	test_must_fail git reflog expire main@{123} 2>stderr && | ||||||
| 	test_i18ngrep "points nowhere" stderr && | 	test_grep "points nowhere" stderr && | ||||||
| 	test_must_fail git reflog expire does-not-exist 2>stderr && | 	test_must_fail git reflog expire does-not-exist 2>stderr && | ||||||
| 	test_i18ngrep "points nowhere" stderr | 	test_grep "points nowhere" stderr | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'checkout should not delete log for packed ref' ' | test_expect_success 'checkout should not delete log for packed ref' ' | ||||||
|  |  | ||||||
|  | @ -37,7 +37,7 @@ test_expect_success 'hook aborts updating ref in prepared state' ' | ||||||
| 		fi | 		fi | ||||||
| 	EOF | 	EOF | ||||||
| 	test_must_fail git update-ref HEAD POST 2>err && | 	test_must_fail git update-ref HEAD POST 2>err && | ||||||
| 	test_i18ngrep "ref updates aborted by hook" err | 	test_grep "ref updates aborted by hook" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'hook gets all queued updates in prepared state' ' | test_expect_success 'hook gets all queued updates in prepared state' ' | ||||||
|  |  | ||||||
|  | @ -47,7 +47,7 @@ test_expect_success 'git branch shows badly named ref as warning' ' | ||||||
| 	test-tool ref-store main update-ref msg "refs/heads/broken...ref" $main_sha1 $ZERO_OID REF_SKIP_REFNAME_VERIFICATION && | 	test-tool ref-store main update-ref msg "refs/heads/broken...ref" $main_sha1 $ZERO_OID REF_SKIP_REFNAME_VERIFICATION && | ||||||
| 	test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/broken...ref" && | 	test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/broken...ref" && | ||||||
| 	git branch >output 2>error && | 	git branch >output 2>error && | ||||||
| 	test_i18ngrep -e "ignoring ref with broken name refs/heads/broken\.\.\.ref" error && | 	test_grep -e "ignoring ref with broken name refs/heads/broken\.\.\.ref" error && | ||||||
| 	! grep -e "broken\.\.\.ref" output | 	! grep -e "broken\.\.\.ref" output | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  | @ -158,7 +158,7 @@ test_expect_success 'rev-parse skips symref pointing to broken name' ' | ||||||
| 	git rev-parse --verify one >expect && | 	git rev-parse --verify one >expect && | ||||||
| 	git rev-parse --verify shadow >actual 2>err && | 	git rev-parse --verify shadow >actual 2>err && | ||||||
| 	test_cmp expect actual && | 	test_cmp expect actual && | ||||||
| 	test_i18ngrep "ignoring dangling symref refs/tags/shadow" err | 	test_grep "ignoring dangling symref refs/tags/shadow" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'for-each-ref emits warnings for broken names' ' | test_expect_success 'for-each-ref emits warnings for broken names' ' | ||||||
|  | @ -172,9 +172,9 @@ test_expect_success 'for-each-ref emits warnings for broken names' ' | ||||||
| 	! grep -e "broken\.\.\.ref" output && | 	! grep -e "broken\.\.\.ref" output && | ||||||
| 	! grep -e "badname" output && | 	! grep -e "badname" output && | ||||||
| 	! grep -e "broken\.\.\.symref" output && | 	! grep -e "broken\.\.\.symref" output && | ||||||
| 	test_i18ngrep "ignoring ref with broken name refs/heads/broken\.\.\.ref" error && | 	test_grep "ignoring ref with broken name refs/heads/broken\.\.\.ref" error && | ||||||
| 	test_i18ngrep ! "ignoring broken ref refs/heads/badname" error && | 	test_grep ! "ignoring broken ref refs/heads/badname" error && | ||||||
| 	test_i18ngrep "ignoring ref with broken name refs/heads/broken\.\.\.symref" error | 	test_grep "ignoring ref with broken name refs/heads/broken\.\.\.symref" error | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'update-ref -d can delete broken name' ' | test_expect_success 'update-ref -d can delete broken name' ' | ||||||
|  | @ -192,7 +192,7 @@ test_expect_success 'branch -d can delete broken name' ' | ||||||
| 	test-tool ref-store main update-ref msg "refs/heads/broken...ref" $main_sha1 $ZERO_OID REF_SKIP_REFNAME_VERIFICATION && | 	test-tool ref-store main update-ref msg "refs/heads/broken...ref" $main_sha1 $ZERO_OID REF_SKIP_REFNAME_VERIFICATION && | ||||||
| 	test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/broken...ref" && | 	test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/broken...ref" && | ||||||
| 	git branch -d broken...ref >output 2>error && | 	git branch -d broken...ref >output 2>error && | ||||||
| 	test_i18ngrep "Deleted branch broken...ref (was broken)" output && | 	test_grep "Deleted branch broken...ref (was broken)" output && | ||||||
| 	test_must_be_empty error && | 	test_must_be_empty error && | ||||||
| 	git branch >output 2>error && | 	git branch >output 2>error && | ||||||
| 	! grep -e "broken\.\.\.ref" error && | 	! grep -e "broken\.\.\.ref" error && | ||||||
|  | @ -220,7 +220,7 @@ test_expect_success 'branch -d can delete symref to broken name' ' | ||||||
| 	test_ref_exists refs/heads/badname && | 	test_ref_exists refs/heads/badname && | ||||||
| 	git branch -d badname >output 2>error && | 	git branch -d badname >output 2>error && | ||||||
| 	test_ref_missing refs/heads/badname && | 	test_ref_missing refs/heads/badname && | ||||||
| 	test_i18ngrep "Deleted branch badname (was refs/heads/broken\.\.\.ref)" output && | 	test_grep "Deleted branch badname (was refs/heads/broken\.\.\.ref)" output && | ||||||
| 	test_must_be_empty error | 	test_must_be_empty error | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  | @ -240,7 +240,7 @@ test_expect_success 'branch -d can delete dangling symref to broken name' ' | ||||||
| 	test_ref_exists refs/heads/badname && | 	test_ref_exists refs/heads/badname && | ||||||
| 	git branch -d badname >output 2>error && | 	git branch -d badname >output 2>error && | ||||||
| 	test_ref_missing refs/heads/badname && | 	test_ref_missing refs/heads/badname && | ||||||
| 	test_i18ngrep "Deleted branch badname (was refs/heads/broken\.\.\.ref)" output && | 	test_grep "Deleted branch badname (was refs/heads/broken\.\.\.ref)" output && | ||||||
| 	test_must_be_empty error | 	test_must_be_empty error | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  | @ -272,7 +272,7 @@ test_expect_success 'branch -d can delete symref with broken name' ' | ||||||
| 	test_ref_exists refs/heads/broken...symref && | 	test_ref_exists refs/heads/broken...symref && | ||||||
| 	git branch -d broken...symref >output 2>error && | 	git branch -d broken...symref >output 2>error && | ||||||
| 	test_ref_missing refs/heads/broken...symref && | 	test_ref_missing refs/heads/broken...symref && | ||||||
| 	test_i18ngrep "Deleted branch broken...symref (was refs/heads/main)" output && | 	test_grep "Deleted branch broken...symref (was refs/heads/main)" output && | ||||||
| 	test_must_be_empty error | 	test_must_be_empty error | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  | @ -292,7 +292,7 @@ test_expect_success 'branch -d can delete dangling symref with broken name' ' | ||||||
| 	test_ref_exists refs/heads/broken...symref && | 	test_ref_exists refs/heads/broken...symref && | ||||||
| 	git branch -d broken...symref >output 2>error && | 	git branch -d broken...symref >output 2>error && | ||||||
| 	test_ref_missing refs/heads/broken...symref && | 	test_ref_missing refs/heads/broken...symref && | ||||||
| 	test_i18ngrep "Deleted branch broken...symref (was refs/heads/idonotexist)" output && | 	test_grep "Deleted branch broken...symref (was refs/heads/idonotexist)" output && | ||||||
| 	test_must_be_empty error | 	test_must_be_empty error | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  | @ -301,7 +301,7 @@ test_expect_success 'update-ref -d cannot delete non-ref in .git dir' ' | ||||||
| 	echo precious >expect && | 	echo precious >expect && | ||||||
| 	test_must_fail git update-ref -d my-private-file >output 2>error && | 	test_must_fail git update-ref -d my-private-file >output 2>error && | ||||||
| 	test_must_be_empty output && | 	test_must_be_empty output && | ||||||
| 	test_i18ngrep -e "refusing to update ref with bad name" error && | 	test_grep -e "refusing to update ref with bad name" error && | ||||||
| 	test_cmp expect .git/my-private-file | 	test_cmp expect .git/my-private-file | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  |  | ||||||
|  | @ -118,7 +118,7 @@ test_expect_success 'branch pointing to non-commit' ' | ||||||
| 	git rev-parse HEAD^{tree} >.git/refs/heads/invalid && | 	git rev-parse HEAD^{tree} >.git/refs/heads/invalid && | ||||||
| 	test_when_finished "git update-ref -d refs/heads/invalid" && | 	test_when_finished "git update-ref -d refs/heads/invalid" && | ||||||
| 	test_must_fail git fsck 2>out && | 	test_must_fail git fsck 2>out && | ||||||
| 	test_i18ngrep "not a commit" out | 	test_grep "not a commit" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'HEAD link pointing at a funny object' ' | test_expect_success 'HEAD link pointing at a funny object' ' | ||||||
|  | @ -127,7 +127,7 @@ test_expect_success 'HEAD link pointing at a funny object' ' | ||||||
| 	echo $ZERO_OID >.git/HEAD && | 	echo $ZERO_OID >.git/HEAD && | ||||||
| 	# avoid corrupt/broken HEAD from interfering with repo discovery | 	# avoid corrupt/broken HEAD from interfering with repo discovery | ||||||
| 	test_must_fail env GIT_DIR=.git git fsck 2>out && | 	test_must_fail env GIT_DIR=.git git fsck 2>out && | ||||||
| 	test_i18ngrep "detached HEAD points" out | 	test_grep "detached HEAD points" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'HEAD link pointing at a funny place' ' | test_expect_success 'HEAD link pointing at a funny place' ' | ||||||
|  | @ -136,7 +136,7 @@ test_expect_success 'HEAD link pointing at a funny place' ' | ||||||
| 	echo "ref: refs/funny/place" >.git/HEAD && | 	echo "ref: refs/funny/place" >.git/HEAD && | ||||||
| 	# avoid corrupt/broken HEAD from interfering with repo discovery | 	# avoid corrupt/broken HEAD from interfering with repo discovery | ||||||
| 	test_must_fail env GIT_DIR=.git git fsck 2>out && | 	test_must_fail env GIT_DIR=.git git fsck 2>out && | ||||||
| 	test_i18ngrep "HEAD points to something strange" out | 	test_grep "HEAD points to something strange" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'HEAD link pointing at a funny object (from different wt)' ' | test_expect_success 'HEAD link pointing at a funny object (from different wt)' ' | ||||||
|  | @ -147,7 +147,7 @@ test_expect_success 'HEAD link pointing at a funny object (from different wt)' ' | ||||||
| 	echo $ZERO_OID >.git/HEAD && | 	echo $ZERO_OID >.git/HEAD && | ||||||
| 	# avoid corrupt/broken HEAD from interfering with repo discovery | 	# avoid corrupt/broken HEAD from interfering with repo discovery | ||||||
| 	test_must_fail git -C wt fsck 2>out && | 	test_must_fail git -C wt fsck 2>out && | ||||||
| 	test_i18ngrep "main-worktree/HEAD: detached HEAD points" out | 	test_grep "main-worktree/HEAD: detached HEAD points" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'other worktree HEAD link pointing at a funny object' ' | test_expect_success 'other worktree HEAD link pointing at a funny object' ' | ||||||
|  | @ -155,7 +155,7 @@ test_expect_success 'other worktree HEAD link pointing at a funny object' ' | ||||||
| 	git worktree add other && | 	git worktree add other && | ||||||
| 	echo $ZERO_OID >.git/worktrees/other/HEAD && | 	echo $ZERO_OID >.git/worktrees/other/HEAD && | ||||||
| 	test_must_fail git fsck 2>out && | 	test_must_fail git fsck 2>out && | ||||||
| 	test_i18ngrep "worktrees/other/HEAD: detached HEAD points" out | 	test_grep "worktrees/other/HEAD: detached HEAD points" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'other worktree HEAD link pointing at missing object' ' | test_expect_success 'other worktree HEAD link pointing at missing object' ' | ||||||
|  | @ -163,7 +163,7 @@ test_expect_success 'other worktree HEAD link pointing at missing object' ' | ||||||
| 	git worktree add other && | 	git worktree add other && | ||||||
| 	echo "Contents missing from repo" | git hash-object --stdin >.git/worktrees/other/HEAD && | 	echo "Contents missing from repo" | git hash-object --stdin >.git/worktrees/other/HEAD && | ||||||
| 	test_must_fail git fsck 2>out && | 	test_must_fail git fsck 2>out && | ||||||
| 	test_i18ngrep "worktrees/other/HEAD: invalid sha1 pointer" out | 	test_grep "worktrees/other/HEAD: invalid sha1 pointer" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'other worktree HEAD link pointing at a funny place' ' | test_expect_success 'other worktree HEAD link pointing at a funny place' ' | ||||||
|  | @ -171,7 +171,7 @@ test_expect_success 'other worktree HEAD link pointing at a funny place' ' | ||||||
| 	git worktree add other && | 	git worktree add other && | ||||||
| 	echo "ref: refs/funny/place" >.git/worktrees/other/HEAD && | 	echo "ref: refs/funny/place" >.git/worktrees/other/HEAD && | ||||||
| 	test_must_fail git fsck 2>out && | 	test_must_fail git fsck 2>out && | ||||||
| 	test_i18ngrep "worktrees/other/HEAD points to something strange" out | 	test_grep "worktrees/other/HEAD points to something strange" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'commit with multiple signatures is okay' ' | test_expect_success 'commit with multiple signatures is okay' ' | ||||||
|  | @ -217,7 +217,7 @@ test_expect_success 'email with embedded > is not okay' ' | ||||||
| 	git update-ref refs/heads/bogus "$new" && | 	git update-ref refs/heads/bogus "$new" && | ||||||
| 	test_when_finished "git update-ref -d refs/heads/bogus" && | 	test_when_finished "git update-ref -d refs/heads/bogus" && | ||||||
| 	test_must_fail git fsck 2>out && | 	test_must_fail git fsck 2>out && | ||||||
| 	test_i18ngrep "error in commit $new" out | 	test_grep "error in commit $new" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'missing < email delimiter is reported nicely' ' | test_expect_success 'missing < email delimiter is reported nicely' ' | ||||||
|  | @ -228,7 +228,7 @@ test_expect_success 'missing < email delimiter is reported nicely' ' | ||||||
| 	git update-ref refs/heads/bogus "$new" && | 	git update-ref refs/heads/bogus "$new" && | ||||||
| 	test_when_finished "git update-ref -d refs/heads/bogus" && | 	test_when_finished "git update-ref -d refs/heads/bogus" && | ||||||
| 	test_must_fail git fsck 2>out && | 	test_must_fail git fsck 2>out && | ||||||
| 	test_i18ngrep "error in commit $new.* - bad name" out | 	test_grep "error in commit $new.* - bad name" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'missing email is reported nicely' ' | test_expect_success 'missing email is reported nicely' ' | ||||||
|  | @ -239,7 +239,7 @@ test_expect_success 'missing email is reported nicely' ' | ||||||
| 	git update-ref refs/heads/bogus "$new" && | 	git update-ref refs/heads/bogus "$new" && | ||||||
| 	test_when_finished "git update-ref -d refs/heads/bogus" && | 	test_when_finished "git update-ref -d refs/heads/bogus" && | ||||||
| 	test_must_fail git fsck 2>out && | 	test_must_fail git fsck 2>out && | ||||||
| 	test_i18ngrep "error in commit $new.* - missing email" out | 	test_grep "error in commit $new.* - missing email" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success '> in name is reported' ' | test_expect_success '> in name is reported' ' | ||||||
|  | @ -250,7 +250,7 @@ test_expect_success '> in name is reported' ' | ||||||
| 	git update-ref refs/heads/bogus "$new" && | 	git update-ref refs/heads/bogus "$new" && | ||||||
| 	test_when_finished "git update-ref -d refs/heads/bogus" && | 	test_when_finished "git update-ref -d refs/heads/bogus" && | ||||||
| 	test_must_fail git fsck 2>out && | 	test_must_fail git fsck 2>out && | ||||||
| 	test_i18ngrep "error in commit $new" out | 	test_grep "error in commit $new" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| # date is 2^64 + 1 | # date is 2^64 + 1 | ||||||
|  | @ -263,7 +263,7 @@ test_expect_success 'integer overflow in timestamps is reported' ' | ||||||
| 	git update-ref refs/heads/bogus "$new" && | 	git update-ref refs/heads/bogus "$new" && | ||||||
| 	test_when_finished "git update-ref -d refs/heads/bogus" && | 	test_when_finished "git update-ref -d refs/heads/bogus" && | ||||||
| 	test_must_fail git fsck 2>out && | 	test_must_fail git fsck 2>out && | ||||||
| 	test_i18ngrep "error in commit $new.*integer overflow" out | 	test_grep "error in commit $new.*integer overflow" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'commit with NUL in header' ' | test_expect_success 'commit with NUL in header' ' | ||||||
|  | @ -274,7 +274,7 @@ test_expect_success 'commit with NUL in header' ' | ||||||
| 	git update-ref refs/heads/bogus "$new" && | 	git update-ref refs/heads/bogus "$new" && | ||||||
| 	test_when_finished "git update-ref -d refs/heads/bogus" && | 	test_when_finished "git update-ref -d refs/heads/bogus" && | ||||||
| 	test_must_fail git fsck 2>out && | 	test_must_fail git fsck 2>out && | ||||||
| 	test_i18ngrep "error in commit $new.*unterminated header: NUL at offset" out | 	test_grep "error in commit $new.*unterminated header: NUL at offset" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'tree object with duplicate entries' ' | test_expect_success 'tree object with duplicate entries' ' | ||||||
|  | @ -295,7 +295,7 @@ test_expect_success 'tree object with duplicate entries' ' | ||||||
| 		git hash-object --literally -w -t tree --stdin | 		git hash-object --literally -w -t tree --stdin | ||||||
| 	) && | 	) && | ||||||
| 	test_must_fail git fsck 2>out && | 	test_must_fail git fsck 2>out && | ||||||
| 	test_i18ngrep "error in tree .*contains duplicate file entries" out | 	test_grep "error in tree .*contains duplicate file entries" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| check_duplicate_names () { | check_duplicate_names () { | ||||||
|  | @ -318,8 +318,8 @@ check_duplicate_names () { | ||||||
| 		done >badtree && | 		done >badtree && | ||||||
| 		badtree=$(git mktree <badtree) && | 		badtree=$(git mktree <badtree) && | ||||||
| 		test_must_fail git fsck 2>out && | 		test_must_fail git fsck 2>out && | ||||||
| 		test_i18ngrep "$badtree" out && | 		test_grep "$badtree" out && | ||||||
| 		test_i18ngrep "error in tree .*contains duplicate file entries" out | 		test_grep "error in tree .*contains duplicate file entries" out | ||||||
| 	' | 	' | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -341,9 +341,9 @@ test_expect_success 'unparseable tree object' ' | ||||||
| 	commit_sha1=$(git commit-tree $tree_sha1) && | 	commit_sha1=$(git commit-tree $tree_sha1) && | ||||||
| 	git update-ref refs/heads/wrong $commit_sha1 && | 	git update-ref refs/heads/wrong $commit_sha1 && | ||||||
| 	test_must_fail git fsck 2>out && | 	test_must_fail git fsck 2>out && | ||||||
| 	test_i18ngrep "error: empty filename in tree entry" out && | 	test_grep "error: empty filename in tree entry" out && | ||||||
| 	test_i18ngrep "$tree_sha1" out && | 	test_grep "$tree_sha1" out && | ||||||
| 	test_i18ngrep ! "fatal: empty filename in tree entry" out | 	test_grep ! "fatal: empty filename in tree entry" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'tree entry with type mismatch' ' | test_expect_success 'tree entry with type mismatch' ' | ||||||
|  | @ -360,8 +360,8 @@ test_expect_success 'tree entry with type mismatch' ' | ||||||
| 	commit=$(git commit-tree $tree) && | 	commit=$(git commit-tree $tree) && | ||||||
| 	git update-ref refs/heads/type_mismatch $commit && | 	git update-ref refs/heads/type_mismatch $commit && | ||||||
| 	test_must_fail git fsck >out 2>&1 && | 	test_must_fail git fsck >out 2>&1 && | ||||||
| 	test_i18ngrep "is a blob, not a tree" out && | 	test_grep "is a blob, not a tree" out && | ||||||
| 	test_i18ngrep ! "dangling blob" out | 	test_grep ! "dangling blob" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'tree entry with bogus mode' ' | test_expect_success 'tree entry with bogus mode' ' | ||||||
|  | @ -394,7 +394,7 @@ test_expect_success 'tag pointing to nonexistent' ' | ||||||
| 	echo $tag >.git/refs/tags/invalid && | 	echo $tag >.git/refs/tags/invalid && | ||||||
| 	test_when_finished "git update-ref -d refs/tags/invalid" && | 	test_when_finished "git update-ref -d refs/tags/invalid" && | ||||||
| 	test_must_fail git fsck --tags >out && | 	test_must_fail git fsck --tags >out && | ||||||
| 	test_i18ngrep "broken link" out | 	test_grep "broken link" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'tag pointing to something else than its type' ' | test_expect_success 'tag pointing to something else than its type' ' | ||||||
|  | @ -455,7 +455,7 @@ test_expect_success 'tag with bad tagger' ' | ||||||
| 	echo $tag >.git/refs/tags/wrong && | 	echo $tag >.git/refs/tags/wrong && | ||||||
| 	test_when_finished "git update-ref -d refs/tags/wrong" && | 	test_when_finished "git update-ref -d refs/tags/wrong" && | ||||||
| 	test_must_fail git fsck --tags 2>out && | 	test_must_fail git fsck --tags 2>out && | ||||||
| 	test_i18ngrep "error in tag .*: invalid author/committer" out | 	test_grep "error in tag .*: invalid author/committer" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'tag with NUL in header' ' | test_expect_success 'tag with NUL in header' ' | ||||||
|  | @ -474,7 +474,7 @@ test_expect_success 'tag with NUL in header' ' | ||||||
| 	echo $tag >.git/refs/tags/wrong && | 	echo $tag >.git/refs/tags/wrong && | ||||||
| 	test_when_finished "git update-ref -d refs/tags/wrong" && | 	test_when_finished "git update-ref -d refs/tags/wrong" && | ||||||
| 	test_must_fail git fsck --tags 2>out && | 	test_must_fail git fsck --tags 2>out && | ||||||
| 	test_i18ngrep "error in tag $tag.*unterminated header: NUL at offset" out | 	test_grep "error in tag $tag.*unterminated header: NUL at offset" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'cleaned up' ' | test_expect_success 'cleaned up' ' | ||||||
|  | @ -504,7 +504,7 @@ test_expect_success 'rev-list --verify-objects with bad sha1' ' | ||||||
| 	test_when_finished "git update-ref -d refs/heads/bogus" && | 	test_when_finished "git update-ref -d refs/heads/bogus" && | ||||||
|  |  | ||||||
| 	test_might_fail git rev-list --verify-objects refs/heads/bogus >/dev/null 2>out && | 	test_might_fail git rev-list --verify-objects refs/heads/bogus >/dev/null 2>out && | ||||||
| 	test_i18ngrep -q "error: hash mismatch $(dirname $new)$(test_oid ff_2)" out | 	test_grep -q "error: hash mismatch $(dirname $new)$(test_oid ff_2)" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| # An actual bit corruption is more likely than swapped commits, but | # An actual bit corruption is more likely than swapped commits, but | ||||||
|  | @ -575,7 +575,7 @@ test_expect_success 'fsck notices blob entry pointing to null sha1' ' | ||||||
| 	 sha=$(printf "100644 file$_bz$_bzoid" | | 	 sha=$(printf "100644 file$_bz$_bzoid" | | ||||||
| 	       git hash-object --literally -w --stdin -t tree) && | 	       git hash-object --literally -w --stdin -t tree) && | ||||||
| 	  git fsck 2>out && | 	  git fsck 2>out && | ||||||
| 	  test_i18ngrep "warning.*null sha1" out | 	  test_grep "warning.*null sha1" out | ||||||
| 	) | 	) | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  | @ -585,7 +585,7 @@ test_expect_success 'fsck notices submodule entry pointing to null sha1' ' | ||||||
| 	 sha=$(printf "160000 submodule$_bz$_bzoid" | | 	 sha=$(printf "160000 submodule$_bz$_bzoid" | | ||||||
| 	       git hash-object --literally -w --stdin -t tree) && | 	       git hash-object --literally -w --stdin -t tree) && | ||||||
| 	  git fsck 2>out && | 	  git fsck 2>out && | ||||||
| 	  test_i18ngrep "warning.*null sha1" out | 	  test_grep "warning.*null sha1" out | ||||||
| 	) | 	) | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  | @ -616,7 +616,7 @@ while read name path pretty; do | ||||||
| 			printf "$mode $type %s\t%s" "$value" "$path" >bad && | 			printf "$mode $type %s\t%s" "$value" "$path" >bad && | ||||||
| 			bad_tree=$(git mktree <bad) && | 			bad_tree=$(git mktree <bad) && | ||||||
| 			git fsck 2>out && | 			git fsck 2>out && | ||||||
| 			test_i18ngrep "warning.*tree $bad_tree" out | 			test_grep "warning.*tree $bad_tree" out | ||||||
| 		)' | 		)' | ||||||
| 	done <<-\EOF | 	done <<-\EOF | ||||||
| 	100644 blob | 	100644 blob | ||||||
|  | @ -662,9 +662,9 @@ test_expect_success 'NUL in commit' ' | ||||||
| 		git branch bad $(cat name) && | 		git branch bad $(cat name) && | ||||||
|  |  | ||||||
| 		test_must_fail git -c fsck.nulInCommit=error fsck 2>warn.1 && | 		test_must_fail git -c fsck.nulInCommit=error fsck 2>warn.1 && | ||||||
| 		test_i18ngrep nulInCommit warn.1 && | 		test_grep nulInCommit warn.1 && | ||||||
| 		git fsck 2>warn.2 && | 		git fsck 2>warn.2 && | ||||||
| 		test_i18ngrep nulInCommit warn.2 | 		test_grep nulInCommit warn.2 | ||||||
| 	) | 	) | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  | @ -784,7 +784,7 @@ test_expect_success 'fsck --name-objects' ' | ||||||
| 		tree=$(git rev-parse --verify julius:) && | 		tree=$(git rev-parse --verify julius:) && | ||||||
| 		git tag -d julius && | 		git tag -d julius && | ||||||
| 		test_must_fail git fsck --name-objects >out && | 		test_must_fail git fsck --name-objects >out && | ||||||
| 		test_i18ngrep "$tree (refs/tags/augustus44\\^:" out | 		test_grep "$tree (refs/tags/augustus44\\^:" out | ||||||
| 	) | 	) | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  | @ -797,7 +797,7 @@ test_expect_success 'alternate objects are correctly blamed' ' | ||||||
| 	mkdir alt.git/objects/$(dirname $path) && | 	mkdir alt.git/objects/$(dirname $path) && | ||||||
| 	>alt.git/objects/$(dirname $path)/$(basename $path) && | 	>alt.git/objects/$(dirname $path)/$(basename $path) && | ||||||
| 	test_must_fail git fsck >out 2>&1 && | 	test_must_fail git fsck >out 2>&1 && | ||||||
| 	test_i18ngrep alt.git out | 	test_grep alt.git out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'fsck errors in packed objects' ' | test_expect_success 'fsck errors in packed objects' ' | ||||||
|  | @ -816,8 +816,8 @@ test_expect_success 'fsck errors in packed objects' ' | ||||||
| 	remove_object $one && | 	remove_object $one && | ||||||
| 	remove_object $two && | 	remove_object $two && | ||||||
| 	test_must_fail git fsck 2>out && | 	test_must_fail git fsck 2>out && | ||||||
| 	test_i18ngrep "error in commit $one.* - bad name" out && | 	test_grep "error in commit $one.* - bad name" out && | ||||||
| 	test_i18ngrep "error in commit $two.* - bad name" out && | 	test_grep "error in commit $two.* - bad name" out && | ||||||
| 	! grep corrupt out | 	! grep corrupt out | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  | @ -834,7 +834,7 @@ test_expect_success 'fsck fails on corrupt packfile' ' | ||||||
| 	test_when_finished "rm -f .git/objects/pack/pack-$pack.*" && | 	test_when_finished "rm -f .git/objects/pack/pack-$pack.*" && | ||||||
| 	remove_object $hsh && | 	remove_object $hsh && | ||||||
| 	test_must_fail git fsck 2>out && | 	test_must_fail git fsck 2>out && | ||||||
| 	test_i18ngrep "checksum mismatch" out | 	test_grep "checksum mismatch" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'fsck finds problems in duplicate loose objects' ' | test_expect_success 'fsck finds problems in duplicate loose objects' ' | ||||||
|  | @ -871,7 +871,7 @@ test_expect_success 'fsck detects trailing loose garbage (commit)' ' | ||||||
| 	chmod +w "$file" && | 	chmod +w "$file" && | ||||||
| 	echo garbage >>"$file" && | 	echo garbage >>"$file" && | ||||||
| 	test_must_fail git fsck 2>out && | 	test_must_fail git fsck 2>out && | ||||||
| 	test_i18ngrep "garbage.*$commit" out | 	test_grep "garbage.*$commit" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'fsck detects trailing loose garbage (large blob)' ' | test_expect_success 'fsck detects trailing loose garbage (large blob)' ' | ||||||
|  | @ -881,7 +881,7 @@ test_expect_success 'fsck detects trailing loose garbage (large blob)' ' | ||||||
| 	chmod +w "$file" && | 	chmod +w "$file" && | ||||||
| 	echo garbage >>"$file" && | 	echo garbage >>"$file" && | ||||||
| 	test_must_fail git -c core.bigfilethreshold=5 fsck 2>out && | 	test_must_fail git -c core.bigfilethreshold=5 fsck 2>out && | ||||||
| 	test_i18ngrep "garbage.*$blob" out | 	test_grep "garbage.*$blob" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'fsck detects truncated loose object' ' | test_expect_success 'fsck detects truncated loose object' ' | ||||||
|  | @ -897,10 +897,10 @@ test_expect_success 'fsck detects truncated loose object' ' | ||||||
|  |  | ||||||
| 	# check both regular and streaming code paths | 	# check both regular and streaming code paths | ||||||
| 	test_must_fail git fsck 2>out && | 	test_must_fail git fsck 2>out && | ||||||
| 	test_i18ngrep corrupt.*$blob out && | 	test_grep corrupt.*$blob out && | ||||||
|  |  | ||||||
| 	test_must_fail git -c core.bigfilethreshold=128 fsck 2>out && | 	test_must_fail git -c core.bigfilethreshold=128 fsck 2>out && | ||||||
| 	test_i18ngrep corrupt.*$blob out | 	test_grep corrupt.*$blob out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| # for each of type, we have one version which is referenced by another object | # for each of type, we have one version which is referenced by another object | ||||||
|  | @ -989,7 +989,7 @@ test_expect_success 'detect corrupt index file in fsck' ' | ||||||
| 	test_when_finished "mv .git/index.backup .git/index" && | 	test_when_finished "mv .git/index.backup .git/index" && | ||||||
| 	corrupt_index_checksum && | 	corrupt_index_checksum && | ||||||
| 	test_must_fail git fsck --cache 2>errors && | 	test_must_fail git fsck --cache 2>errors && | ||||||
| 	test_i18ngrep "bad index file" errors | 	test_grep "bad index file" errors | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'fsck error and recovery on invalid object type' ' | test_expect_success 'fsck error and recovery on invalid object type' ' | ||||||
|  |  | ||||||
|  | @ -107,16 +107,16 @@ test_expect_success 'correct relative file objects (6)' ' | ||||||
|  |  | ||||||
| test_expect_success 'incorrect revision id' ' | test_expect_success 'incorrect revision id' ' | ||||||
| 	test_must_fail git rev-parse foobar:file.txt 2>error && | 	test_must_fail git rev-parse foobar:file.txt 2>error && | ||||||
| 	test_i18ngrep "invalid object name .foobar." error && | 	test_grep "invalid object name .foobar." error && | ||||||
| 	test_must_fail git rev-parse foobar 2>error && | 	test_must_fail git rev-parse foobar 2>error && | ||||||
| 	test_i18ngrep "unknown revision or path not in the working tree." error | 	test_grep "unknown revision or path not in the working tree." error | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'incorrect file in sha1:path' ' | test_expect_success 'incorrect file in sha1:path' ' | ||||||
| 	test_must_fail git rev-parse HEAD:nothing.txt 2>error && | 	test_must_fail git rev-parse HEAD:nothing.txt 2>error && | ||||||
| 	test_i18ngrep "path .nothing.txt. does not exist in .HEAD." error && | 	test_grep "path .nothing.txt. does not exist in .HEAD." error && | ||||||
| 	test_must_fail git rev-parse HEAD:index-only.txt 2>error && | 	test_must_fail git rev-parse HEAD:index-only.txt 2>error && | ||||||
| 	test_i18ngrep "path .index-only.txt. exists on disk, but not in .HEAD." error && | 	test_grep "path .index-only.txt. exists on disk, but not in .HEAD." error && | ||||||
| 	(cd subdir && | 	(cd subdir && | ||||||
| 	 test_must_fail git rev-parse HEAD:file2.txt 2>error && | 	 test_must_fail git rev-parse HEAD:file2.txt 2>error && | ||||||
| 	 test_did_you_mean HEAD subdir/ file2.txt exists ) | 	 test_did_you_mean HEAD subdir/ file2.txt exists ) | ||||||
|  | @ -124,9 +124,9 @@ test_expect_success 'incorrect file in sha1:path' ' | ||||||
|  |  | ||||||
| test_expect_success 'incorrect file in :path and :N:path' ' | test_expect_success 'incorrect file in :path and :N:path' ' | ||||||
| 	test_must_fail git rev-parse :nothing.txt 2>error && | 	test_must_fail git rev-parse :nothing.txt 2>error && | ||||||
| 	test_i18ngrep "path .nothing.txt. does not exist (neither on disk nor in the index)" error && | 	test_grep "path .nothing.txt. does not exist (neither on disk nor in the index)" error && | ||||||
| 	test_must_fail git rev-parse :1:nothing.txt 2>error && | 	test_must_fail git rev-parse :1:nothing.txt 2>error && | ||||||
| 	test_i18ngrep "path .nothing.txt. does not exist (neither on disk nor in the index)" error && | 	test_grep "path .nothing.txt. does not exist (neither on disk nor in the index)" error && | ||||||
| 	test_must_fail git rev-parse :1:file.txt 2>error && | 	test_must_fail git rev-parse :1:file.txt 2>error && | ||||||
| 	test_did_you_mean ":0" "" file.txt "is in the index" "at stage 1" && | 	test_did_you_mean ":0" "" file.txt "is in the index" "at stage 1" && | ||||||
| 	(cd subdir && | 	(cd subdir && | ||||||
|  | @ -137,42 +137,42 @@ test_expect_success 'incorrect file in :path and :N:path' ' | ||||||
| 	 test_must_fail git rev-parse :2:file2.txt 2>error && | 	 test_must_fail git rev-parse :2:file2.txt 2>error && | ||||||
| 	 test_did_you_mean :0 subdir/ file2.txt "is in the index") && | 	 test_did_you_mean :0 subdir/ file2.txt "is in the index") && | ||||||
| 	test_must_fail git rev-parse :disk-only.txt 2>error && | 	test_must_fail git rev-parse :disk-only.txt 2>error && | ||||||
| 	test_i18ngrep "path .disk-only.txt. exists on disk, but not in the index" error | 	test_grep "path .disk-only.txt. exists on disk, but not in the index" error | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'invalid @{n} reference' ' | test_expect_success 'invalid @{n} reference' ' | ||||||
| 	test_must_fail git rev-parse main@{99999} >output 2>error && | 	test_must_fail git rev-parse main@{99999} >output 2>error && | ||||||
| 	test_must_be_empty output && | 	test_must_be_empty output && | ||||||
| 	test_i18ngrep "log for [^ ]* only has [0-9][0-9]* entries" error  && | 	test_grep "log for [^ ]* only has [0-9][0-9]* entries" error  && | ||||||
| 	test_must_fail git rev-parse --verify main@{99999} >output 2>error && | 	test_must_fail git rev-parse --verify main@{99999} >output 2>error && | ||||||
| 	test_must_be_empty output && | 	test_must_be_empty output && | ||||||
| 	test_i18ngrep "log for [^ ]* only has [0-9][0-9]* entries" error | 	test_grep "log for [^ ]* only has [0-9][0-9]* entries" error | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'relative path not found' ' | test_expect_success 'relative path not found' ' | ||||||
| 	( | 	( | ||||||
| 		cd subdir && | 		cd subdir && | ||||||
| 		test_must_fail git rev-parse HEAD:./nonexistent.txt 2>error && | 		test_must_fail git rev-parse HEAD:./nonexistent.txt 2>error && | ||||||
| 		test_i18ngrep subdir/nonexistent.txt error | 		test_grep subdir/nonexistent.txt error | ||||||
| 	) | 	) | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'relative path outside worktree' ' | test_expect_success 'relative path outside worktree' ' | ||||||
| 	test_must_fail git rev-parse HEAD:../file.txt >output 2>error && | 	test_must_fail git rev-parse HEAD:../file.txt >output 2>error && | ||||||
| 	test_must_be_empty output && | 	test_must_be_empty output && | ||||||
| 	test_i18ngrep "outside repository" error | 	test_grep "outside repository" error | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'relative path when cwd is outside worktree' ' | test_expect_success 'relative path when cwd is outside worktree' ' | ||||||
| 	test_must_fail git --git-dir=.git --work-tree=subdir rev-parse HEAD:./file.txt >output 2>error && | 	test_must_fail git --git-dir=.git --work-tree=subdir rev-parse HEAD:./file.txt >output 2>error && | ||||||
| 	test_must_be_empty output && | 	test_must_be_empty output && | ||||||
| 	test_i18ngrep "relative path syntax can.t be used outside working tree" error | 	test_grep "relative path syntax can.t be used outside working tree" error | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success '<commit>:file correctly diagnosed after a pathname' ' | test_expect_success '<commit>:file correctly diagnosed after a pathname' ' | ||||||
| 	test_must_fail git rev-parse file.txt HEAD:file.txt 1>actual 2>error && | 	test_must_fail git rev-parse file.txt HEAD:file.txt 1>actual 2>error && | ||||||
| 	test_i18ngrep ! "exists on disk" error && | 	test_grep ! "exists on disk" error && | ||||||
| 	test_i18ngrep "no such path in the working tree" error && | 	test_grep "no such path in the working tree" error && | ||||||
| 	cat >expect <<-\EOF && | 	cat >expect <<-\EOF && | ||||||
| 	file.txt | 	file.txt | ||||||
| 	HEAD:file.txt | 	HEAD:file.txt | ||||||
|  | @ -214,13 +214,13 @@ test_expect_success 'dotdot does not peel endpoints' ' | ||||||
|  |  | ||||||
| test_expect_success 'arg before dashdash must be a revision (missing)' ' | test_expect_success 'arg before dashdash must be a revision (missing)' ' | ||||||
| 	test_must_fail git rev-parse foobar -- 2>stderr && | 	test_must_fail git rev-parse foobar -- 2>stderr && | ||||||
| 	test_i18ngrep "bad revision" stderr | 	test_grep "bad revision" stderr | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'arg before dashdash must be a revision (file)' ' | test_expect_success 'arg before dashdash must be a revision (file)' ' | ||||||
| 	>foobar && | 	>foobar && | ||||||
| 	test_must_fail git rev-parse foobar -- 2>stderr && | 	test_must_fail git rev-parse foobar -- 2>stderr && | ||||||
| 	test_i18ngrep "bad revision" stderr | 	test_grep "bad revision" stderr | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'arg before dashdash must be a revision (ambiguous)' ' | test_expect_success 'arg before dashdash must be a revision (ambiguous)' ' | ||||||
|  | @ -269,7 +269,7 @@ test_expect_success 'arg after dashdash not interpreted as option' ' | ||||||
|  |  | ||||||
| test_expect_success 'arg after end-of-options not interpreted as option' ' | test_expect_success 'arg after end-of-options not interpreted as option' ' | ||||||
| 	test_must_fail git rev-parse --end-of-options --not-real -- 2>err && | 	test_must_fail git rev-parse --end-of-options --not-real -- 2>err && | ||||||
| 	test_i18ngrep bad.revision.*--not-real err | 	test_grep bad.revision.*--not-real err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'end-of-options still allows --' ' | test_expect_success 'end-of-options still allows --' ' | ||||||
|  |  | ||||||
|  | @ -129,7 +129,7 @@ test_expect_success 'blob and tree' ' | ||||||
|  |  | ||||||
| test_expect_success 'warn ambiguity when no candidate matches type hint' ' | test_expect_success 'warn ambiguity when no candidate matches type hint' ' | ||||||
| 	test_must_fail git rev-parse --verify 000000000^{commit} 2>actual && | 	test_must_fail git rev-parse --verify 000000000^{commit} 2>actual && | ||||||
| 	test_i18ngrep "short object ID 000000000 is ambiguous" actual | 	test_grep "short object ID 000000000 is ambiguous" actual | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'disambiguate tree-ish' ' | test_expect_success 'disambiguate tree-ish' ' | ||||||
|  | @ -470,10 +470,10 @@ test_expect_success 'cat-file --batch and --batch-check show ambiguous' ' | ||||||
| 	echo "0000 ambiguous" >expect && | 	echo "0000 ambiguous" >expect && | ||||||
| 	echo 0000 | git cat-file --batch-check >actual 2>err && | 	echo 0000 | git cat-file --batch-check >actual 2>err && | ||||||
| 	test_cmp expect actual && | 	test_cmp expect actual && | ||||||
| 	test_i18ngrep hint: err && | 	test_grep hint: err && | ||||||
| 	echo 0000 | git cat-file --batch >actual 2>err && | 	echo 0000 | git cat-file --batch >actual 2>err && | ||||||
| 	test_cmp expect actual && | 	test_cmp expect actual && | ||||||
| 	test_i18ngrep hint: err | 	test_grep hint: err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_done | test_done | ||||||
|  |  | ||||||
|  | @ -93,7 +93,7 @@ test_expect_success 'checkout all stages of unknown path' ' | ||||||
| 	rm -f path* .merge_* actual && | 	rm -f path* .merge_* actual && | ||||||
| 	test_must_fail git checkout-index --stage=all --temp \ | 	test_must_fail git checkout-index --stage=all --temp \ | ||||||
| 		-- does-not-exist 2>stderr && | 		-- does-not-exist 2>stderr && | ||||||
| 	test_i18ngrep not.in.the.cache stderr | 	test_grep not.in.the.cache stderr | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'checkout all stages/one file to nothing' ' | test_expect_success 'checkout all stages/one file to nothing' ' | ||||||
|  |  | ||||||
|  | @ -8,7 +8,7 @@ TEST_PASSES_SANITIZE_LEAK=true | ||||||
|  |  | ||||||
| test_expect_success 'checkout-index --gobbledegook' ' | test_expect_success 'checkout-index --gobbledegook' ' | ||||||
| 	test_expect_code 129 git checkout-index --gobbledegook 2>err && | 	test_expect_code 129 git checkout-index --gobbledegook 2>err && | ||||||
| 	test_i18ngrep "[Uu]sage" err | 	test_grep "[Uu]sage" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'checkout-index -h in broken repository' ' | test_expect_success 'checkout-index -h in broken repository' ' | ||||||
|  | @ -19,18 +19,18 @@ test_expect_success 'checkout-index -h in broken repository' ' | ||||||
| 		>.git/index && | 		>.git/index && | ||||||
| 		test_expect_code 129 git checkout-index -h >usage 2>&1 | 		test_expect_code 129 git checkout-index -h >usage 2>&1 | ||||||
| 	) && | 	) && | ||||||
| 	test_i18ngrep "[Uu]sage" broken/usage | 	test_grep "[Uu]sage" broken/usage | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'checkout-index reports errors (cmdline)' ' | test_expect_success 'checkout-index reports errors (cmdline)' ' | ||||||
| 	test_must_fail git checkout-index -- does-not-exist 2>stderr && | 	test_must_fail git checkout-index -- does-not-exist 2>stderr && | ||||||
| 	test_i18ngrep not.in.the.cache stderr | 	test_grep not.in.the.cache stderr | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'checkout-index reports errors (stdin)' ' | test_expect_success 'checkout-index reports errors (stdin)' ' | ||||||
| 	echo does-not-exist | | 	echo does-not-exist | | ||||||
| 	test_must_fail git checkout-index --stdin 2>stderr && | 	test_must_fail git checkout-index --stdin 2>stderr && | ||||||
| 	test_i18ngrep not.in.the.cache stderr | 	test_grep not.in.the.cache stderr | ||||||
| ' | ' | ||||||
| for mode in 'case' 'utf-8' | for mode in 'case' 'utf-8' | ||||||
| do | do | ||||||
|  | @ -88,8 +88,8 @@ test_expect_success 'checkout-index --temp correctly reports error on missing bl | ||||||
| 	git update-index --index-info <objs && | 	git update-index --index-info <objs && | ||||||
|  |  | ||||||
| 	test_must_fail git checkout-index --temp symlink file 2>stderr && | 	test_must_fail git checkout-index --temp symlink file 2>stderr && | ||||||
| 	test_i18ngrep "unable to read sha1 file of file ($missing_blob)" stderr && | 	test_grep "unable to read sha1 file of file ($missing_blob)" stderr && | ||||||
| 	test_i18ngrep "unable to read sha1 file of symlink ($missing_blob)" stderr | 	test_grep "unable to read sha1 file of symlink ($missing_blob)" stderr | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'checkout-index --temp correctly reports error for submodules' ' | test_expect_success 'checkout-index --temp correctly reports error for submodules' ' | ||||||
|  | @ -98,7 +98,7 @@ test_expect_success 'checkout-index --temp correctly reports error for submodule | ||||||
| 	git submodule add ./sub && | 	git submodule add ./sub && | ||||||
| 	git commit -m sub && | 	git commit -m sub && | ||||||
| 	test_must_fail git checkout-index --temp sub 2>stderr && | 	test_must_fail git checkout-index --temp sub 2>stderr && | ||||||
| 	test_i18ngrep "cannot create temporary submodule sub" stderr | 	test_grep "cannot create temporary submodule sub" stderr | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_done | test_done | ||||||
|  |  | ||||||
|  | @ -62,8 +62,8 @@ test_expect_success 'disambiguate checking out from a tree-ish' ' | ||||||
|  |  | ||||||
| test_expect_success 'accurate error message with more than one ref' ' | test_expect_success 'accurate error message with more than one ref' ' | ||||||
| 	test_must_fail git checkout HEAD main -- 2>actual && | 	test_must_fail git checkout HEAD main -- 2>actual && | ||||||
| 	test_i18ngrep 2 actual && | 	test_grep 2 actual && | ||||||
| 	test_i18ngrep "one reference expected, 2 given" actual | 	test_grep "one reference expected, 2 given" actual | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_done | test_done | ||||||
|  |  | ||||||
|  | @ -278,12 +278,12 @@ test_expect_success 'checkout -b to a new branch preserves mergeable changes des | ||||||
|  |  | ||||||
| test_expect_success 'checkout -b rejects an invalid start point' ' | test_expect_success 'checkout -b rejects an invalid start point' ' | ||||||
| 	test_must_fail git checkout -b branch4 file1 2>err && | 	test_must_fail git checkout -b branch4 file1 2>err && | ||||||
| 	test_i18ngrep "is not a commit" err | 	test_grep "is not a commit" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'checkout -b rejects an extra path argument' ' | test_expect_success 'checkout -b rejects an extra path argument' ' | ||||||
| 	test_must_fail git checkout -b branch5 branch1 file1 2>err && | 	test_must_fail git checkout -b branch5 branch1 file1 2>err && | ||||||
| 	test_i18ngrep "Cannot update paths and switch to branch" err | 	test_grep "Cannot update paths and switch to branch" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_done | test_done | ||||||
|  |  | ||||||
|  | @ -32,8 +32,8 @@ test_expect_success 'checkout chooses branch over tag' ' | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'checkout reports switch to branch' ' | test_expect_success 'checkout reports switch to branch' ' | ||||||
| 	test_i18ngrep "Switched to branch" stderr && | 	test_grep "Switched to branch" stderr && | ||||||
| 	test_i18ngrep ! "^HEAD is now at" stderr | 	test_grep ! "^HEAD is now at" stderr | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'checkout vague ref succeeds' ' | test_expect_success 'checkout vague ref succeeds' ' | ||||||
|  | @ -54,8 +54,8 @@ test_expect_success VAGUENESS_SUCCESS 'checkout chooses branch over tag' ' | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success VAGUENESS_SUCCESS 'checkout reports switch to branch' ' | test_expect_success VAGUENESS_SUCCESS 'checkout reports switch to branch' ' | ||||||
| 	test_i18ngrep "Switched to branch" stderr && | 	test_grep "Switched to branch" stderr && | ||||||
| 	test_i18ngrep ! "^HEAD is now at" stderr | 	test_grep ! "^HEAD is now at" stderr | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_done | test_done | ||||||
|  |  | ||||||
|  | @ -17,12 +17,12 @@ check_not_detached () { | ||||||
|  |  | ||||||
| PREV_HEAD_DESC='Previous HEAD position was' | PREV_HEAD_DESC='Previous HEAD position was' | ||||||
| check_orphan_warning() { | check_orphan_warning() { | ||||||
| 	test_i18ngrep "you are leaving $2 behind" "$1" && | 	test_grep "you are leaving $2 behind" "$1" && | ||||||
| 	test_i18ngrep ! "$PREV_HEAD_DESC" "$1" | 	test_grep ! "$PREV_HEAD_DESC" "$1" | ||||||
| } | } | ||||||
| check_no_orphan_warning() { | check_no_orphan_warning() { | ||||||
| 	test_i18ngrep ! "you are leaving .* commit.*behind" "$1" && | 	test_grep ! "you are leaving .* commit.*behind" "$1" && | ||||||
| 	test_i18ngrep "$PREV_HEAD_DESC" "$1" | 	test_grep "$PREV_HEAD_DESC" "$1" | ||||||
| } | } | ||||||
|  |  | ||||||
| reset () { | reset () { | ||||||
|  |  | ||||||
|  | @ -93,7 +93,7 @@ test_expect_success 'when arg matches multiple remotes, do not fallback to inter | ||||||
|  |  | ||||||
| 	test_must_fail git checkout ambiguous_branch_and_file 2>err && | 	test_must_fail git checkout ambiguous_branch_and_file 2>err && | ||||||
|  |  | ||||||
| 	test_i18ngrep "matched multiple (2) remote tracking branches" err && | 	test_grep "matched multiple (2) remote tracking branches" err && | ||||||
|  |  | ||||||
| 	# file must not be altered | 	# file must not be altered | ||||||
| 	test_cmp expect ambiguous_branch_and_file | 	test_cmp expect ambiguous_branch_and_file | ||||||
|  | @ -105,12 +105,12 @@ test_expect_success 'checkout of branch from multiple remotes fails with advice' | ||||||
| 	test_must_fail git checkout foo 2>stderr && | 	test_must_fail git checkout foo 2>stderr && | ||||||
| 	test_branch main && | 	test_branch main && | ||||||
| 	status_uno_is_clean && | 	status_uno_is_clean && | ||||||
| 	test_i18ngrep "^hint: " stderr && | 	test_grep "^hint: " stderr && | ||||||
| 	test_must_fail git -c advice.checkoutAmbiguousRemoteBranchName=false \ | 	test_must_fail git -c advice.checkoutAmbiguousRemoteBranchName=false \ | ||||||
| 		checkout foo 2>stderr && | 		checkout foo 2>stderr && | ||||||
| 	test_branch main && | 	test_branch main && | ||||||
| 	status_uno_is_clean && | 	status_uno_is_clean && | ||||||
| 	test_i18ngrep ! "^hint: " stderr | 	test_grep ! "^hint: " stderr | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success PERL 'checkout -p with multiple remotes does not print advice' ' | test_expect_success PERL 'checkout -p with multiple remotes does not print advice' ' | ||||||
|  | @ -118,7 +118,7 @@ test_expect_success PERL 'checkout -p with multiple remotes does not print advic | ||||||
| 	test_might_fail git branch -D foo && | 	test_might_fail git branch -D foo && | ||||||
|  |  | ||||||
| 	git checkout -p foo 2>stderr && | 	git checkout -p foo 2>stderr && | ||||||
| 	test_i18ngrep ! "^hint: " stderr && | 	test_grep ! "^hint: " stderr && | ||||||
| 	status_uno_is_clean | 	status_uno_is_clean | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  |  | ||||||
|  | @ -26,7 +26,7 @@ test_expect_success 'checkout --no-overlay removing last file from directory' ' | ||||||
|  |  | ||||||
| test_expect_success 'checkout -p --overlay is disallowed' ' | test_expect_success 'checkout -p --overlay is disallowed' ' | ||||||
| 	test_must_fail git checkout -p --overlay HEAD 2>actual && | 	test_must_fail git checkout -p --overlay HEAD 2>actual && | ||||||
| 	test_i18ngrep "fatal: options .-p. and .--overlay. cannot be used together" actual | 	test_grep "fatal: options .-p. and .--overlay. cannot be used together" actual | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success '--no-overlay --theirs with D/F conflict deletes file' ' | test_expect_success '--no-overlay --theirs with D/F conflict deletes file' ' | ||||||
|  |  | ||||||
|  | @ -149,16 +149,16 @@ test_expect_success 'error conditions' ' | ||||||
| 	echo fileA.t >list && | 	echo fileA.t >list && | ||||||
|  |  | ||||||
| 	test_must_fail git checkout --pathspec-from-file=list --detach 2>err && | 	test_must_fail git checkout --pathspec-from-file=list --detach 2>err && | ||||||
| 	test_i18ngrep -e "options .--pathspec-from-file. and .--detach. cannot be used together" err && | 	test_grep -e "options .--pathspec-from-file. and .--detach. cannot be used together" err && | ||||||
|  |  | ||||||
| 	test_must_fail git checkout --pathspec-from-file=list --patch 2>err && | 	test_must_fail git checkout --pathspec-from-file=list --patch 2>err && | ||||||
| 	test_i18ngrep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err && | 	test_grep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err && | ||||||
|  |  | ||||||
| 	test_must_fail git checkout --pathspec-from-file=list -- fileA.t 2>err && | 	test_must_fail git checkout --pathspec-from-file=list -- fileA.t 2>err && | ||||||
| 	test_i18ngrep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err && | 	test_grep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err && | ||||||
|  |  | ||||||
| 	test_must_fail git checkout --pathspec-file-nul 2>err && | 	test_must_fail git checkout --pathspec-file-nul 2>err && | ||||||
| 	test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err | 	test_grep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_done | test_done | ||||||
|  |  | ||||||
|  | @ -22,7 +22,7 @@ test_expect_success 'checkout --track -b creates a new tracking branch' ' | ||||||
|  |  | ||||||
| test_expect_success 'checkout --track -b rejects an extra path argument' ' | test_expect_success 'checkout --track -b rejects an extra path argument' ' | ||||||
| 	test_must_fail git checkout --track -b branch2 main one.t 2>err && | 	test_must_fail git checkout --track -b branch2 main one.t 2>err && | ||||||
| 	test_i18ngrep "cannot be used with updating paths" err | 	test_grep "cannot be used with updating paths" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'checkout --track -b overrides autoSetupMerge=inherit' ' | test_expect_success 'checkout --track -b overrides autoSetupMerge=inherit' ' | ||||||
|  |  | ||||||
|  | @ -228,7 +228,7 @@ test_expect_success 'rerere forget (add-add conflict)' ' | ||||||
| 	git commit -m "add differently" && | 	git commit -m "add differently" && | ||||||
| 	test_must_fail git merge fifth && | 	test_must_fail git merge fifth && | ||||||
| 	git rerere forget add-differently 2>actual && | 	git rerere forget add-differently 2>actual && | ||||||
| 	test_i18ngrep "no remembered" actual | 	test_grep "no remembered" actual | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'resolve-undo keeps blobs from gc' ' | test_expect_success 'resolve-undo keeps blobs from gc' ' | ||||||
|  |  | ||||||
|  | @ -152,16 +152,16 @@ test_expect_success 'error conditions' ' | ||||||
| 	>empty_list && | 	>empty_list && | ||||||
|  |  | ||||||
| 	test_must_fail git restore --pathspec-from-file=list --patch --source=HEAD^1 2>err && | 	test_must_fail git restore --pathspec-from-file=list --patch --source=HEAD^1 2>err && | ||||||
| 	test_i18ngrep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err && | 	test_grep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err && | ||||||
|  |  | ||||||
| 	test_must_fail git restore --pathspec-from-file=list --source=HEAD^1 -- fileA.t 2>err && | 	test_must_fail git restore --pathspec-from-file=list --source=HEAD^1 -- fileA.t 2>err && | ||||||
| 	test_i18ngrep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err && | 	test_grep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err && | ||||||
|  |  | ||||||
| 	test_must_fail git restore --pathspec-file-nul --source=HEAD^1 2>err && | 	test_must_fail git restore --pathspec-file-nul --source=HEAD^1 2>err && | ||||||
| 	test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err && | 	test_grep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err && | ||||||
|  |  | ||||||
| 	test_must_fail git restore --pathspec-from-file=empty_list --source=HEAD^1 2>err && | 	test_must_fail git restore --pathspec-from-file=empty_list --source=HEAD^1 2>err && | ||||||
| 	test_i18ngrep -e "you must specify path(s) to restore" err | 	test_grep -e "you must specify path(s) to restore" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'wildcard pathspec matches file in subdirectory' ' | test_expect_success 'wildcard pathspec matches file in subdirectory' ' | ||||||
|  |  | ||||||
|  | @ -22,7 +22,7 @@ test_expect_success 'do not switch branches with dirty file' ' | ||||||
| 	echo dirt >file && | 	echo dirt >file && | ||||||
| 	git update-index --assume-unchanged file && | 	git update-index --assume-unchanged file && | ||||||
| 	test_must_fail git checkout - 2>err && | 	test_must_fail git checkout - 2>err && | ||||||
| 	test_i18ngrep overwritten err | 	test_grep overwritten err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_done | test_done | ||||||
|  |  | ||||||
|  | @ -14,7 +14,7 @@ test_expect_success 'update-index --nonsense fails' ' | ||||||
|  |  | ||||||
| test_expect_success 'update-index --nonsense dumps usage' ' | test_expect_success 'update-index --nonsense dumps usage' ' | ||||||
| 	test_expect_code 129 git update-index --nonsense 2>err && | 	test_expect_code 129 git update-index --nonsense 2>err && | ||||||
| 	test_i18ngrep "[Uu]sage: git update-index" err | 	test_grep "[Uu]sage: git update-index" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'update-index -h with corrupt index' ' | test_expect_success 'update-index -h with corrupt index' ' | ||||||
|  | @ -25,7 +25,7 @@ test_expect_success 'update-index -h with corrupt index' ' | ||||||
| 		>.git/index && | 		>.git/index && | ||||||
| 		test_expect_code 129 git update-index -h >usage 2>&1 | 		test_expect_code 129 git update-index -h >usage 2>&1 | ||||||
| 	) && | 	) && | ||||||
| 	test_i18ngrep "[Uu]sage: git update-index" broken/usage | 	test_grep "[Uu]sage: git update-index" broken/usage | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success '--cacheinfo complains of missing arguments' ' | test_expect_success '--cacheinfo complains of missing arguments' ' | ||||||
|  |  | ||||||
|  | @ -173,7 +173,7 @@ test_expect_success 'rename detection finds the right names' ' | ||||||
| 		git add -N third && | 		git add -N third && | ||||||
|  |  | ||||||
| 		git status | grep -v "^?" >actual.1 && | 		git status | grep -v "^?" >actual.1 && | ||||||
| 		test_i18ngrep "renamed: *first -> third" actual.1 && | 		test_grep "renamed: *first -> third" actual.1 && | ||||||
|  |  | ||||||
| 		git status --porcelain | grep -v "^?" >actual.2 && | 		git status --porcelain | grep -v "^?" >actual.2 && | ||||||
| 		cat >expected.2 <<-\EOF && | 		cat >expected.2 <<-\EOF && | ||||||
|  | @ -213,8 +213,8 @@ test_expect_success 'double rename detection in status' ' | ||||||
| 		git add -N third && | 		git add -N third && | ||||||
|  |  | ||||||
| 		git status | grep -v "^?" >actual.1 && | 		git status | grep -v "^?" >actual.1 && | ||||||
| 		test_i18ngrep "renamed: *first -> second" actual.1 && | 		test_grep "renamed: *first -> second" actual.1 && | ||||||
| 		test_i18ngrep "renamed: *second -> third" actual.1 && | 		test_grep "renamed: *second -> third" actual.1 && | ||||||
|  |  | ||||||
| 		git status --porcelain | grep -v "^?" >actual.2 && | 		git status --porcelain | grep -v "^?" >actual.2 && | ||||||
| 		cat >expected.2 <<-\EOF && | 		cat >expected.2 <<-\EOF && | ||||||
|  |  | ||||||
|  | @ -36,7 +36,7 @@ do | ||||||
| 	' | 	' | ||||||
|  |  | ||||||
| 	test_expect_success "complaints for ignored $i output" ' | 	test_expect_success "complaints for ignored $i output" ' | ||||||
| 		test_i18ngrep -e "Use -f if" err | 		test_grep -e "Use -f if" err | ||||||
| 	' | 	' | ||||||
|  |  | ||||||
| 	test_expect_success "complaints for ignored $i with unignored file" ' | 	test_expect_success "complaints for ignored $i with unignored file" ' | ||||||
|  | @ -46,7 +46,7 @@ do | ||||||
| 		test_must_be_empty out | 		test_must_be_empty out | ||||||
| 	' | 	' | ||||||
| 	test_expect_success "complaints for ignored $i with unignored file output" ' | 	test_expect_success "complaints for ignored $i with unignored file output" ' | ||||||
| 		test_i18ngrep -e "Use -f if" err | 		test_grep -e "Use -f if" err | ||||||
| 	' | 	' | ||||||
| done | done | ||||||
|  |  | ||||||
|  | @ -65,7 +65,7 @@ do | ||||||
| 	test_expect_success "complaints for ignored $i in dir output" ' | 	test_expect_success "complaints for ignored $i in dir output" ' | ||||||
| 		( | 		( | ||||||
| 			cd dir && | 			cd dir && | ||||||
| 			test_i18ngrep -e "Use -f if" err | 			test_grep -e "Use -f if" err | ||||||
| 		) | 		) | ||||||
| 	' | 	' | ||||||
| done | done | ||||||
|  | @ -85,7 +85,7 @@ do | ||||||
| 	test_expect_success "complaints for ignored $i in sub output" ' | 	test_expect_success "complaints for ignored $i in sub output" ' | ||||||
| 		( | 		( | ||||||
| 			cd sub && | 			cd sub && | ||||||
| 			test_i18ngrep -e "Use -f if" err | 			test_grep -e "Use -f if" err | ||||||
| 		) | 		) | ||||||
| 	' | 	' | ||||||
| done | done | ||||||
|  |  | ||||||
|  | @ -47,7 +47,7 @@ test_expect_success SANITY 'prune directories with unreadable gitdir' ' | ||||||
| 	: >.git/worktrees/def/gitdir && | 	: >.git/worktrees/def/gitdir && | ||||||
| 	chmod u-r .git/worktrees/def/gitdir && | 	chmod u-r .git/worktrees/def/gitdir && | ||||||
| 	git worktree prune --verbose 2>actual && | 	git worktree prune --verbose 2>actual && | ||||||
| 	test_i18ngrep "Removing worktrees/def: unable to read gitdir file" actual && | 	test_grep "Removing worktrees/def: unable to read gitdir file" actual && | ||||||
| 	! test -d .git/worktrees/def && | 	! test -d .git/worktrees/def && | ||||||
| 	! test -d .git/worktrees | 	! test -d .git/worktrees | ||||||
| ' | ' | ||||||
|  | @ -57,7 +57,7 @@ test_expect_success 'prune directories with invalid gitdir' ' | ||||||
| 	: >.git/worktrees/def/def && | 	: >.git/worktrees/def/def && | ||||||
| 	: >.git/worktrees/def/gitdir && | 	: >.git/worktrees/def/gitdir && | ||||||
| 	git worktree prune --verbose 2>actual && | 	git worktree prune --verbose 2>actual && | ||||||
| 	test_i18ngrep "Removing worktrees/def: invalid gitdir file" actual && | 	test_grep "Removing worktrees/def: invalid gitdir file" actual && | ||||||
| 	! test -d .git/worktrees/def && | 	! test -d .git/worktrees/def && | ||||||
| 	! test -d .git/worktrees | 	! test -d .git/worktrees | ||||||
| ' | ' | ||||||
|  | @ -67,7 +67,7 @@ test_expect_success 'prune directories with gitdir pointing to nowhere' ' | ||||||
| 	: >.git/worktrees/def/def && | 	: >.git/worktrees/def/def && | ||||||
| 	echo "$(pwd)"/nowhere >.git/worktrees/def/gitdir && | 	echo "$(pwd)"/nowhere >.git/worktrees/def/gitdir && | ||||||
| 	git worktree prune --verbose 2>actual && | 	git worktree prune --verbose 2>actual && | ||||||
| 	test_i18ngrep "Removing worktrees/def: gitdir file points to non-existent location" actual && | 	test_grep "Removing worktrees/def: gitdir file points to non-existent location" actual && | ||||||
| 	! test -d .git/worktrees/def && | 	! test -d .git/worktrees/def && | ||||||
| 	! test -d .git/worktrees | 	! test -d .git/worktrees | ||||||
| ' | ' | ||||||
|  | @ -103,7 +103,7 @@ test_expect_success 'prune duplicate (linked/linked)' ' | ||||||
| 	sed "s/w2/w1/" .git/worktrees/w2/gitdir >.git/worktrees/w2/gitdir.new && | 	sed "s/w2/w1/" .git/worktrees/w2/gitdir >.git/worktrees/w2/gitdir.new && | ||||||
| 	mv .git/worktrees/w2/gitdir.new .git/worktrees/w2/gitdir && | 	mv .git/worktrees/w2/gitdir.new .git/worktrees/w2/gitdir && | ||||||
| 	git worktree prune --verbose 2>actual && | 	git worktree prune --verbose 2>actual && | ||||||
| 	test_i18ngrep "duplicate entry" actual && | 	test_grep "duplicate entry" actual && | ||||||
| 	test -d .git/worktrees/w1 && | 	test -d .git/worktrees/w1 && | ||||||
| 	! test -d .git/worktrees/w2 | 	! test -d .git/worktrees/w2 | ||||||
| ' | ' | ||||||
|  | @ -116,7 +116,7 @@ test_expect_success 'prune duplicate (main/linked)' ' | ||||||
| 	rm -fr wt && | 	rm -fr wt && | ||||||
| 	mv repo wt && | 	mv repo wt && | ||||||
| 	git -C wt worktree prune --verbose 2>actual && | 	git -C wt worktree prune --verbose 2>actual && | ||||||
| 	test_i18ngrep "duplicate entry" actual && | 	test_grep "duplicate entry" actual && | ||||||
| 	! test -d .git/worktrees/wt | 	! test -d .git/worktrees/wt | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  |  | ||||||
|  | @ -143,7 +143,7 @@ test_expect_success '"list" all worktrees --porcelain with prunable' ' | ||||||
| 	rm -rf prunable && | 	rm -rf prunable && | ||||||
| 	git worktree list --porcelain >out && | 	git worktree list --porcelain >out && | ||||||
| 	sed -n "/^worktree .*\/prunable$/,/^$/p" <out >only_prunable && | 	sed -n "/^worktree .*\/prunable$/,/^$/p" <out >only_prunable && | ||||||
| 	test_i18ngrep "^prunable gitdir file points to non-existent location$" only_prunable | 	test_grep "^prunable gitdir file points to non-existent location$" only_prunable | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success '"list" all worktrees with prunable consistent with "prune"' ' | test_expect_success '"list" all worktrees with prunable consistent with "prune"' ' | ||||||
|  | @ -155,8 +155,8 @@ test_expect_success '"list" all worktrees with prunable consistent with "prune"' | ||||||
| 	grep "/prunable  *[0-9a-f].* prunable$" out && | 	grep "/prunable  *[0-9a-f].* prunable$" out && | ||||||
| 	! grep "/unprunable  *[0-9a-f].* unprunable$" out && | 	! grep "/unprunable  *[0-9a-f].* unprunable$" out && | ||||||
| 	git worktree prune --verbose 2>out && | 	git worktree prune --verbose 2>out && | ||||||
| 	test_i18ngrep "^Removing worktrees/prunable" out && | 	test_grep "^Removing worktrees/prunable" out && | ||||||
| 	test_i18ngrep ! "^Removing worktrees/unprunable" out | 	test_grep ! "^Removing worktrees/unprunable" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success '"list" --verbose and --porcelain mutually exclusive' ' | test_expect_success '"list" --verbose and --porcelain mutually exclusive' ' | ||||||
|  |  | ||||||
|  | @ -202,7 +202,7 @@ test_expect_success 'proper error when worktree not found' ' | ||||||
| 	for i in noodle noodle/bork | 	for i in noodle noodle/bork | ||||||
| 	do | 	do | ||||||
| 		test_must_fail git worktree lock $i 2>err && | 		test_must_fail git worktree lock $i 2>err && | ||||||
| 		test_i18ngrep "not a working tree" err || return 1 | 		test_grep "not a working tree" err || return 1 | ||||||
| 	done | 	done | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  |  | ||||||
|  | @ -25,7 +25,7 @@ test_expect_success 'worktree path not directory' ' | ||||||
| 	>notdir && | 	>notdir && | ||||||
| 	test_must_fail git worktree repair >out 2>err && | 	test_must_fail git worktree repair >out 2>err && | ||||||
| 	test_must_be_empty out && | 	test_must_be_empty out && | ||||||
| 	test_i18ngrep "not a directory" err | 	test_grep "not a directory" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success "don't clobber .git repo" ' | test_expect_success "don't clobber .git repo" ' | ||||||
|  | @ -35,7 +35,7 @@ test_expect_success "don't clobber .git repo" ' | ||||||
| 	test_create_repo repo && | 	test_create_repo repo && | ||||||
| 	test_must_fail git worktree repair >out 2>err && | 	test_must_fail git worktree repair >out 2>err && | ||||||
| 	test_must_be_empty out && | 	test_must_be_empty out && | ||||||
| 	test_i18ngrep ".git is not a file" err | 	test_grep ".git is not a file" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_corrupt_gitfile () { | test_corrupt_gitfile () { | ||||||
|  | @ -47,7 +47,7 @@ test_corrupt_gitfile () { | ||||||
| 	git -C corrupt rev-parse --absolute-git-dir >expect && | 	git -C corrupt rev-parse --absolute-git-dir >expect && | ||||||
| 	eval "$butcher" && | 	eval "$butcher" && | ||||||
| 	git -C "$repairdir" worktree repair 2>err && | 	git -C "$repairdir" worktree repair 2>err && | ||||||
| 	test_i18ngrep "$problem" err && | 	test_grep "$problem" err && | ||||||
| 	git -C corrupt rev-parse --absolute-git-dir >actual && | 	git -C corrupt rev-parse --absolute-git-dir >actual && | ||||||
| 	test_cmp expect actual | 	test_cmp expect actual | ||||||
| } | } | ||||||
|  | @ -93,7 +93,7 @@ test_expect_success 'repair .git file from bare.git' ' | ||||||
| test_expect_success 'invalid worktree path' ' | test_expect_success 'invalid worktree path' ' | ||||||
| 	test_must_fail git worktree repair /notvalid >out 2>err && | 	test_must_fail git worktree repair /notvalid >out 2>err && | ||||||
| 	test_must_be_empty out && | 	test_must_be_empty out && | ||||||
| 	test_i18ngrep "not a valid path" err | 	test_grep "not a valid path" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'repo not found; .git not file' ' | test_expect_success 'repo not found; .git not file' ' | ||||||
|  | @ -101,7 +101,7 @@ test_expect_success 'repo not found; .git not file' ' | ||||||
| 	test_create_repo not-a-worktree && | 	test_create_repo not-a-worktree && | ||||||
| 	test_must_fail git worktree repair not-a-worktree >out 2>err && | 	test_must_fail git worktree repair not-a-worktree >out 2>err && | ||||||
| 	test_must_be_empty out && | 	test_must_be_empty out && | ||||||
| 	test_i18ngrep ".git is not a file" err | 	test_grep ".git is not a file" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'repo not found; .git not referencing repo' ' | test_expect_success 'repo not found; .git not referencing repo' ' | ||||||
|  | @ -111,7 +111,7 @@ test_expect_success 'repo not found; .git not referencing repo' ' | ||||||
| 	mv side/.newgit side/.git && | 	mv side/.newgit side/.git && | ||||||
| 	mkdir not-a-repo && | 	mkdir not-a-repo && | ||||||
| 	test_must_fail git worktree repair side 2>err && | 	test_must_fail git worktree repair side 2>err && | ||||||
| 	test_i18ngrep ".git file does not reference a repository" err | 	test_grep ".git file does not reference a repository" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'repo not found; .git file broken' ' | test_expect_success 'repo not found; .git file broken' ' | ||||||
|  | @ -121,7 +121,7 @@ test_expect_success 'repo not found; .git file broken' ' | ||||||
| 	mv orig moved && | 	mv orig moved && | ||||||
| 	test_must_fail git worktree repair moved >out 2>err && | 	test_must_fail git worktree repair moved >out 2>err && | ||||||
| 	test_must_be_empty out && | 	test_must_be_empty out && | ||||||
| 	test_i18ngrep ".git file broken" err | 	test_grep ".git file broken" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'repair broken gitdir' ' | test_expect_success 'repair broken gitdir' ' | ||||||
|  | @ -132,7 +132,7 @@ test_expect_success 'repair broken gitdir' ' | ||||||
| 	mv orig moved && | 	mv orig moved && | ||||||
| 	git worktree repair moved 2>err && | 	git worktree repair moved 2>err && | ||||||
| 	test_cmp expect .git/worktrees/orig/gitdir && | 	test_cmp expect .git/worktrees/orig/gitdir && | ||||||
| 	test_i18ngrep "gitdir unreadable" err | 	test_grep "gitdir unreadable" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'repair incorrect gitdir' ' | test_expect_success 'repair incorrect gitdir' ' | ||||||
|  | @ -142,7 +142,7 @@ test_expect_success 'repair incorrect gitdir' ' | ||||||
| 	mv orig moved && | 	mv orig moved && | ||||||
| 	git worktree repair moved 2>err && | 	git worktree repair moved 2>err && | ||||||
| 	test_cmp expect .git/worktrees/orig/gitdir && | 	test_cmp expect .git/worktrees/orig/gitdir && | ||||||
| 	test_i18ngrep "gitdir incorrect" err | 	test_grep "gitdir incorrect" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'repair gitdir (implicit) from linked worktree' ' | test_expect_success 'repair gitdir (implicit) from linked worktree' ' | ||||||
|  | @ -152,7 +152,7 @@ test_expect_success 'repair gitdir (implicit) from linked worktree' ' | ||||||
| 	mv orig moved && | 	mv orig moved && | ||||||
| 	git -C moved worktree repair 2>err && | 	git -C moved worktree repair 2>err && | ||||||
| 	test_cmp expect .git/worktrees/orig/gitdir && | 	test_cmp expect .git/worktrees/orig/gitdir && | ||||||
| 	test_i18ngrep "gitdir incorrect" err | 	test_grep "gitdir incorrect" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'unable to repair gitdir (implicit) from main worktree' ' | test_expect_success 'unable to repair gitdir (implicit) from main worktree' ' | ||||||
|  | @ -177,8 +177,8 @@ test_expect_success 'repair multiple gitdir files' ' | ||||||
| 	git worktree repair moved1 moved2 2>err && | 	git worktree repair moved1 moved2 2>err && | ||||||
| 	test_cmp expect1 .git/worktrees/orig1/gitdir && | 	test_cmp expect1 .git/worktrees/orig1/gitdir && | ||||||
| 	test_cmp expect2 .git/worktrees/orig2/gitdir && | 	test_cmp expect2 .git/worktrees/orig2/gitdir && | ||||||
| 	test_i18ngrep "gitdir incorrect:.*orig1/gitdir$" err && | 	test_grep "gitdir incorrect:.*orig1/gitdir$" err && | ||||||
| 	test_i18ngrep "gitdir incorrect:.*orig2/gitdir$" err | 	test_grep "gitdir incorrect:.*orig2/gitdir$" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'repair moved main and linked worktrees' ' | test_expect_success 'repair moved main and linked worktrees' ' | ||||||
|  |  | ||||||
|  | @ -21,7 +21,7 @@ test_expect_success 'ls-files with nonexistent path' ' | ||||||
|  |  | ||||||
| test_expect_success 'ls-files with nonsense option' ' | test_expect_success 'ls-files with nonsense option' ' | ||||||
| 	test_expect_code 129 git ls-files --nonsense 2>actual && | 	test_expect_code 129 git ls-files --nonsense 2>actual && | ||||||
| 	test_i18ngrep "[Uu]sage: git ls-files" actual | 	test_grep "[Uu]sage: git ls-files" actual | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'ls-files -h in corrupt repository' ' | test_expect_success 'ls-files -h in corrupt repository' ' | ||||||
|  | @ -32,7 +32,7 @@ test_expect_success 'ls-files -h in corrupt repository' ' | ||||||
| 		>.git/index && | 		>.git/index && | ||||||
| 		test_expect_code 129 git ls-files -h >usage 2>&1 | 		test_expect_code 129 git ls-files -h >usage 2>&1 | ||||||
| 	) && | 	) && | ||||||
| 	test_i18ngrep "[Uu]sage: git ls-files " broken/usage | 	test_grep "[Uu]sage: git ls-files " broken/usage | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success SYMLINKS 'ls-files with absolute paths to symlinks' ' | test_expect_success SYMLINKS 'ls-files with absolute paths to symlinks' ' | ||||||
|  |  | ||||||
|  | @ -296,7 +296,7 @@ test_expect_success '--recurse-submodules and relative paths' ' | ||||||
|  |  | ||||||
| test_expect_success '--recurse-submodules does not support --error-unmatch' ' | test_expect_success '--recurse-submodules does not support --error-unmatch' ' | ||||||
| 	test_must_fail git ls-files --recurse-submodules --error-unmatch 2>actual && | 	test_must_fail git ls-files --recurse-submodules --error-unmatch 2>actual && | ||||||
| 	test_i18ngrep "does not support --error-unmatch" actual | 	test_grep "does not support --error-unmatch" actual | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success '--recurse-submodules parses submodule repo config' ' | test_expect_success '--recurse-submodules parses submodule repo config' ' | ||||||
|  | @ -335,7 +335,7 @@ test_expect_success '--recurse-submodules submodules ignore super project worktr | ||||||
| test_incompatible_with_recurse_submodules () { | test_incompatible_with_recurse_submodules () { | ||||||
| 	test_expect_success "--recurse-submodules and $1 are incompatible" " | 	test_expect_success "--recurse-submodules and $1 are incompatible" " | ||||||
| 		test_must_fail git ls-files --recurse-submodules $1 2>actual && | 		test_must_fail git ls-files --recurse-submodules $1 2>actual && | ||||||
| 		test_i18ngrep 'unsupported mode' actual | 		test_grep 'unsupported mode' actual | ||||||
| 	" | 	" | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  | @ -36,7 +36,7 @@ test_expect_success 'branch -h in broken repository' ' | ||||||
| 		>.git/refs/heads/main && | 		>.git/refs/heads/main && | ||||||
| 		test_expect_code 129 git branch -h >usage 2>&1 | 		test_expect_code 129 git branch -h >usage 2>&1 | ||||||
| 	) && | 	) && | ||||||
| 	test_i18ngrep "[Uu]sage" broken/usage | 	test_grep "[Uu]sage" broken/usage | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'git branch abc should create a branch' ' | test_expect_success 'git branch abc should create a branch' ' | ||||||
|  | @ -106,7 +106,7 @@ test_expect_success 'git branch l should work after branch l/m has been deleted' | ||||||
|  |  | ||||||
| test_expect_success 'git branch -m dumps usage' ' | test_expect_success 'git branch -m dumps usage' ' | ||||||
| 	test_expect_code 128 git branch -m 2>err && | 	test_expect_code 128 git branch -m 2>err && | ||||||
| 	test_i18ngrep "branch name required" err | 	test_grep "branch name required" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'git branch -m m broken_symref should work' ' | test_expect_success 'git branch -m m broken_symref should work' ' | ||||||
|  | @ -584,12 +584,12 @@ EOF | ||||||
|  |  | ||||||
| test_expect_success 'git branch -c dumps usage' ' | test_expect_success 'git branch -c dumps usage' ' | ||||||
| 	test_expect_code 128 git branch -c 2>err && | 	test_expect_code 128 git branch -c 2>err && | ||||||
| 	test_i18ngrep "branch name required" err | 	test_grep "branch name required" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'git branch --copy dumps usage' ' | test_expect_success 'git branch --copy dumps usage' ' | ||||||
| 	test_expect_code 128 git branch --copy 2>err && | 	test_expect_code 128 git branch --copy 2>err && | ||||||
| 	test_i18ngrep "branch name required" err | 	test_grep "branch name required" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'git branch -c d e should work' ' | test_expect_success 'git branch -c d e should work' ' | ||||||
|  | @ -1040,7 +1040,7 @@ test_expect_success '--set-upstream-to fails on a missing dst branch' ' | ||||||
|  |  | ||||||
| test_expect_success '--set-upstream-to fails on a missing src branch' ' | test_expect_success '--set-upstream-to fails on a missing src branch' ' | ||||||
| 	test_must_fail git branch --set-upstream-to does-not-exist main 2>err && | 	test_must_fail git branch --set-upstream-to does-not-exist main 2>err && | ||||||
| 	test_i18ngrep "the requested upstream branch '"'"'does-not-exist'"'"' does not exist" err | 	test_grep "the requested upstream branch '"'"'does-not-exist'"'"' does not exist" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success '--set-upstream-to fails on a non-ref' ' | test_expect_success '--set-upstream-to fails on a non-ref' ' | ||||||
|  | @ -1054,7 +1054,7 @@ test_expect_success '--set-upstream-to fails on locked config' ' | ||||||
| 	>.git/config.lock && | 	>.git/config.lock && | ||||||
| 	git branch locked && | 	git branch locked && | ||||||
| 	test_must_fail git branch --set-upstream-to locked 2>err && | 	test_must_fail git branch --set-upstream-to locked 2>err && | ||||||
| 	test_i18ngrep "could not lock config file .git/config" err | 	test_grep "could not lock config file .git/config" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'use --set-upstream-to modify HEAD' ' | test_expect_success 'use --set-upstream-to modify HEAD' ' | ||||||
|  | @ -1085,7 +1085,7 @@ test_expect_success '--unset-upstream should fail if config is locked' ' | ||||||
| 	git branch --set-upstream-to locked && | 	git branch --set-upstream-to locked && | ||||||
| 	>.git/config.lock && | 	>.git/config.lock && | ||||||
| 	test_must_fail git branch --unset-upstream 2>err && | 	test_must_fail git branch --unset-upstream 2>err && | ||||||
| 	test_i18ngrep "could not lock config file .git/config" err | 	test_grep "could not lock config file .git/config" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'test --unset-upstream on HEAD' ' | test_expect_success 'test --unset-upstream on HEAD' ' | ||||||
|  | @ -1521,7 +1521,7 @@ test_expect_success '--list during rebase' ' | ||||||
| 	set_fake_editor && | 	set_fake_editor && | ||||||
| 	git rebase -i HEAD~2 && | 	git rebase -i HEAD~2 && | ||||||
| 	git branch --list >actual && | 	git branch --list >actual && | ||||||
| 	test_i18ngrep "rebasing main" actual | 	test_grep "rebasing main" actual | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success '--list during rebase from detached HEAD' ' | test_expect_success '--list during rebase from detached HEAD' ' | ||||||
|  | @ -1533,7 +1533,7 @@ test_expect_success '--list during rebase from detached HEAD' ' | ||||||
| 	set_fake_editor && | 	set_fake_editor && | ||||||
| 	git rebase -i HEAD~2 && | 	git rebase -i HEAD~2 && | ||||||
| 	git branch --list >actual && | 	git branch --list >actual && | ||||||
| 	test_i18ngrep "rebasing detached HEAD $oid" actual | 	test_grep "rebasing detached HEAD $oid" actual | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'tracking with unexpected .fetch refspec' ' | test_expect_success 'tracking with unexpected .fetch refspec' ' | ||||||
|  |  | ||||||
|  | @ -253,7 +253,7 @@ test_expect_success 'error descriptions on orphan branch' ' | ||||||
| 	test_branch_op_in_wt() { | 	test_branch_op_in_wt() { | ||||||
| 		test_orphan_error() { | 		test_orphan_error() { | ||||||
| 			test_must_fail git $* 2>actual && | 			test_must_fail git $* 2>actual && | ||||||
| 			test_i18ngrep "no commit on branch .orphan-branch. yet$" actual | 			test_grep "no commit on branch .orphan-branch. yet$" actual | ||||||
| 		} && | 		} && | ||||||
| 		test_orphan_error -C wt branch $1 $2 &&                # implicit branch | 		test_orphan_error -C wt branch $1 $2 &&                # implicit branch | ||||||
| 		test_orphan_error -C wt branch $1 orphan-branch $2 &&  # explicit branch | 		test_orphan_error -C wt branch $1 orphan-branch $2 &&  # explicit branch | ||||||
|  |  | ||||||
|  | @ -195,7 +195,7 @@ test_expect_success 'A^! and A^-<n> (unmodified)' ' | ||||||
|  |  | ||||||
| test_expect_success 'A^{/..} is not mistaken for a range' ' | test_expect_success 'A^{/..} is not mistaken for a range' ' | ||||||
| 	test_must_fail git range-diff topic^.. topic^{/..} -- 2>error && | 	test_must_fail git range-diff topic^.. topic^{/..} -- 2>error && | ||||||
| 	test_i18ngrep "not a commit range" error | 	test_grep "not a commit range" error | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'trivial reordering' ' | test_expect_success 'trivial reordering' ' | ||||||
|  | @ -537,7 +537,7 @@ do | ||||||
| 			main..unmodified >actual && | 			main..unmodified >actual && | ||||||
| 		test_when_finished "rm 000?-*" && | 		test_when_finished "rm 000?-*" && | ||||||
| 		test_line_count = 5 actual && | 		test_line_count = 5 actual && | ||||||
| 		test_i18ngrep "^Range-diff:$" 0000-* && | 		test_grep "^Range-diff:$" 0000-* && | ||||||
| 		grep "= 1: .* s/5/A" 0000-* && | 		grep "= 1: .* s/5/A" 0000-* && | ||||||
| 		grep "= 2: .* s/4/A" 0000-* && | 		grep "= 2: .* s/4/A" 0000-* && | ||||||
| 		grep "= 3: .* s/11/B" 0000-* && | 		grep "= 3: .* s/11/B" 0000-* && | ||||||
|  | @ -549,7 +549,7 @@ test_expect_success 'format-patch --range-diff as commentary' ' | ||||||
| 	git format-patch --range-diff=HEAD~1 HEAD~1 >actual && | 	git format-patch --range-diff=HEAD~1 HEAD~1 >actual && | ||||||
| 	test_when_finished "rm 0001-*" && | 	test_when_finished "rm 0001-*" && | ||||||
| 	test_line_count = 1 actual && | 	test_line_count = 1 actual && | ||||||
| 	test_i18ngrep "^Range-diff:$" 0001-* && | 	test_grep "^Range-diff:$" 0001-* && | ||||||
| 	grep "> 1: .* new message" 0001-* | 	grep "> 1: .* new message" 0001-* | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  | @ -557,7 +557,7 @@ test_expect_success 'format-patch --range-diff reroll-count with a non-integer' | ||||||
| 	git format-patch --range-diff=HEAD~1 -v2.9 HEAD~1 >actual && | 	git format-patch --range-diff=HEAD~1 -v2.9 HEAD~1 >actual && | ||||||
| 	test_when_finished "rm v2.9-0001-*" && | 	test_when_finished "rm v2.9-0001-*" && | ||||||
| 	test_line_count = 1 actual && | 	test_line_count = 1 actual && | ||||||
| 	test_i18ngrep "^Range-diff:$" v2.9-0001-* && | 	test_grep "^Range-diff:$" v2.9-0001-* && | ||||||
| 	grep "> 1: .* new message" v2.9-0001-* | 	grep "> 1: .* new message" v2.9-0001-* | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  | @ -565,7 +565,7 @@ test_expect_success 'format-patch --range-diff reroll-count with a integer' ' | ||||||
| 	git format-patch --range-diff=HEAD~1 -v2 HEAD~1 >actual && | 	git format-patch --range-diff=HEAD~1 -v2 HEAD~1 >actual && | ||||||
| 	test_when_finished "rm v2-0001-*" && | 	test_when_finished "rm v2-0001-*" && | ||||||
| 	test_line_count = 1 actual && | 	test_line_count = 1 actual && | ||||||
| 	test_i18ngrep "^Range-diff ..* v1:$" v2-0001-* && | 	test_grep "^Range-diff ..* v1:$" v2-0001-* && | ||||||
| 	grep "> 1: .* new message" v2-0001-* | 	grep "> 1: .* new message" v2-0001-* | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  | @ -573,7 +573,7 @@ test_expect_success 'format-patch --range-diff with v0' ' | ||||||
| 	git format-patch --range-diff=HEAD~1 -v0 HEAD~1 >actual && | 	git format-patch --range-diff=HEAD~1 -v0 HEAD~1 >actual && | ||||||
| 	test_when_finished "rm v0-0001-*" && | 	test_when_finished "rm v0-0001-*" && | ||||||
| 	test_line_count = 1 actual && | 	test_line_count = 1 actual && | ||||||
| 	test_i18ngrep "^Range-diff:$" v0-0001-* && | 	test_grep "^Range-diff:$" v0-0001-* && | ||||||
| 	grep "> 1: .* new message" v0-0001-* | 	grep "> 1: .* new message" v0-0001-* | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  | @ -684,7 +684,7 @@ test_expect_success 'format-patch --range-diff does not compare notes by default | ||||||
| 		main..unmodified >actual && | 		main..unmodified >actual && | ||||||
| 	test_when_finished "rm 000?-*" && | 	test_when_finished "rm 000?-*" && | ||||||
| 	test_line_count = 5 actual && | 	test_line_count = 5 actual && | ||||||
| 	test_i18ngrep "^Range-diff:$" 0000-* && | 	test_grep "^Range-diff:$" 0000-* && | ||||||
| 	grep "= 1: .* s/5/A" 0000-* && | 	grep "= 1: .* s/5/A" 0000-* && | ||||||
| 	grep "= 2: .* s/4/A" 0000-* && | 	grep "= 2: .* s/4/A" 0000-* && | ||||||
| 	grep "= 3: .* s/11/B" 0000-* && | 	grep "= 3: .* s/11/B" 0000-* && | ||||||
|  | @ -715,7 +715,7 @@ test_expect_success 'format-patch --range-diff with --no-notes' ' | ||||||
| 		main..unmodified >actual && | 		main..unmodified >actual && | ||||||
| 	test_when_finished "rm 000?-*" && | 	test_when_finished "rm 000?-*" && | ||||||
| 	test_line_count = 5 actual && | 	test_line_count = 5 actual && | ||||||
| 	test_i18ngrep "^Range-diff:$" 0000-* && | 	test_grep "^Range-diff:$" 0000-* && | ||||||
| 	grep "= 1: .* s/5/A" 0000-* && | 	grep "= 1: .* s/5/A" 0000-* && | ||||||
| 	grep "= 2: .* s/4/A" 0000-* && | 	grep "= 2: .* s/4/A" 0000-* && | ||||||
| 	grep "= 3: .* s/11/B" 0000-* && | 	grep "= 3: .* s/11/B" 0000-* && | ||||||
|  | @ -732,7 +732,7 @@ test_expect_success 'format-patch --range-diff with --notes' ' | ||||||
| 		main..unmodified >actual && | 		main..unmodified >actual && | ||||||
| 	test_when_finished "rm 000?-*" && | 	test_when_finished "rm 000?-*" && | ||||||
| 	test_line_count = 5 actual && | 	test_line_count = 5 actual && | ||||||
| 	test_i18ngrep "^Range-diff:$" 0000-* && | 	test_grep "^Range-diff:$" 0000-* && | ||||||
| 	grep "= 1: .* s/5/A" 0000-* && | 	grep "= 1: .* s/5/A" 0000-* && | ||||||
| 	grep "= 2: .* s/4/A" 0000-* && | 	grep "= 2: .* s/4/A" 0000-* && | ||||||
| 	grep "= 3: .* s/11/B" 0000-* && | 	grep "= 3: .* s/11/B" 0000-* && | ||||||
|  | @ -761,7 +761,7 @@ test_expect_success 'format-patch --range-diff with format.notes config' ' | ||||||
| 		main..unmodified >actual && | 		main..unmodified >actual && | ||||||
| 	test_when_finished "rm 000?-*" && | 	test_when_finished "rm 000?-*" && | ||||||
| 	test_line_count = 5 actual && | 	test_line_count = 5 actual && | ||||||
| 	test_i18ngrep "^Range-diff:$" 0000-* && | 	test_grep "^Range-diff:$" 0000-* && | ||||||
| 	grep "= 1: .* s/5/A" 0000-* && | 	grep "= 1: .* s/5/A" 0000-* && | ||||||
| 	grep "= 2: .* s/4/A" 0000-* && | 	grep "= 2: .* s/4/A" 0000-* && | ||||||
| 	grep "= 3: .* s/11/B" 0000-* && | 	grep "= 3: .* s/11/B" 0000-* && | ||||||
|  | @ -792,7 +792,7 @@ test_expect_success 'format-patch --range-diff with multiple notes' ' | ||||||
| 		main..unmodified >actual && | 		main..unmodified >actual && | ||||||
| 	test_when_finished "rm 000?-*" && | 	test_when_finished "rm 000?-*" && | ||||||
| 	test_line_count = 5 actual && | 	test_line_count = 5 actual && | ||||||
| 	test_i18ngrep "^Range-diff:$" 0000-* && | 	test_grep "^Range-diff:$" 0000-* && | ||||||
| 	grep "= 1: .* s/5/A" 0000-* && | 	grep "= 1: .* s/5/A" 0000-* && | ||||||
| 	grep "= 2: .* s/4/A" 0000-* && | 	grep "= 2: .* s/4/A" 0000-* && | ||||||
| 	grep "= 3: .* s/11/B" 0000-* && | 	grep "= 3: .* s/11/B" 0000-* && | ||||||
|  |  | ||||||
|  | @ -227,7 +227,7 @@ test_expect_success 'notice d/f conflict with existing directory' ' | ||||||
|  |  | ||||||
| test_expect_success 'existing directory reports concrete ref' ' | test_expect_success 'existing directory reports concrete ref' ' | ||||||
| 	test_must_fail git branch foo 2>stderr && | 	test_must_fail git branch foo 2>stderr && | ||||||
| 	test_i18ngrep refs/heads/foo/bar/baz stderr | 	test_grep refs/heads/foo/bar/baz stderr | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'notice d/f conflict with existing ref' ' | test_expect_success 'notice d/f conflict with existing ref' ' | ||||||
|  |  | ||||||
|  | @ -1469,9 +1469,9 @@ test_expect_success 'GIT_NOTES_REWRITE_REF overrides config' ' | ||||||
|  |  | ||||||
| test_expect_success 'git notes copy diagnoses too many or too few arguments' ' | test_expect_success 'git notes copy diagnoses too many or too few arguments' ' | ||||||
| 	test_must_fail git notes copy 2>error && | 	test_must_fail git notes copy 2>error && | ||||||
| 	test_i18ngrep "too few arguments" error && | 	test_grep "too few arguments" error && | ||||||
| 	test_must_fail git notes copy one two three 2>error && | 	test_must_fail git notes copy one two three 2>error && | ||||||
| 	test_i18ngrep "too many arguments" error | 	test_grep "too many arguments" error | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'git notes get-ref expands refs/heads/main to refs/notes/refs/heads/main' ' | test_expect_success 'git notes get-ref expands refs/heads/main to refs/notes/refs/heads/main' ' | ||||||
|  |  | ||||||
|  | @ -216,7 +216,7 @@ test_expect_success 'merge z into m (== y) with default ("manual") resolver => C | ||||||
| 	git config core.notesRef refs/notes/m && | 	git config core.notesRef refs/notes/m && | ||||||
| 	test_must_fail git notes merge z >output 2>&1 && | 	test_must_fail git notes merge z >output 2>&1 && | ||||||
| 	# Output should point to where to resolve conflicts | 	# Output should point to where to resolve conflicts | ||||||
| 	test_i18ngrep "\\.git/NOTES_MERGE_WORKTREE" output && | 	test_grep "\\.git/NOTES_MERGE_WORKTREE" output && | ||||||
| 	# Inspect merge conflicts | 	# Inspect merge conflicts | ||||||
| 	ls .git/NOTES_MERGE_WORKTREE >output_conflicts && | 	ls .git/NOTES_MERGE_WORKTREE >output_conflicts && | ||||||
| 	test_cmp expect_conflicts output_conflicts && | 	test_cmp expect_conflicts output_conflicts && | ||||||
|  | @ -263,7 +263,7 @@ test_expect_success 'cannot do merge w/conflicts when previous merge is unfinish | ||||||
| 	test -d .git/NOTES_MERGE_WORKTREE && | 	test -d .git/NOTES_MERGE_WORKTREE && | ||||||
| 	test_must_fail git notes merge z >output 2>&1 && | 	test_must_fail git notes merge z >output 2>&1 && | ||||||
| 	# Output should indicate what is wrong | 	# Output should indicate what is wrong | ||||||
| 	test_i18ngrep -q "\\.git/NOTES_MERGE_\\* exists" output | 	test_grep -q "\\.git/NOTES_MERGE_\\* exists" output | ||||||
| ' | ' | ||||||
|  |  | ||||||
| # Setup non-conflicting merge between x and new notes ref w | # Setup non-conflicting merge between x and new notes ref w | ||||||
|  | @ -417,7 +417,7 @@ test_expect_success 'redo merge of z into m (== y) with default ("manual") resol | ||||||
| 	git config core.notesRef refs/notes/m && | 	git config core.notesRef refs/notes/m && | ||||||
| 	test_must_fail git notes merge z >output 2>&1 && | 	test_must_fail git notes merge z >output 2>&1 && | ||||||
| 	# Output should point to where to resolve conflicts | 	# Output should point to where to resolve conflicts | ||||||
| 	test_i18ngrep "\\.git/NOTES_MERGE_WORKTREE" output && | 	test_grep "\\.git/NOTES_MERGE_WORKTREE" output && | ||||||
| 	# Inspect merge conflicts | 	# Inspect merge conflicts | ||||||
| 	ls .git/NOTES_MERGE_WORKTREE >output_conflicts && | 	ls .git/NOTES_MERGE_WORKTREE >output_conflicts && | ||||||
| 	test_cmp expect_conflicts output_conflicts && | 	test_cmp expect_conflicts output_conflicts && | ||||||
|  | @ -449,7 +449,7 @@ git rev-parse refs/notes/z > pre_merge_z | ||||||
| test_expect_success 'redo merge of z into m (== y) with default ("manual") resolver => Conflicting 3-way merge' ' | test_expect_success 'redo merge of z into m (== y) with default ("manual") resolver => Conflicting 3-way merge' ' | ||||||
| 	test_must_fail git notes merge z >output 2>&1 && | 	test_must_fail git notes merge z >output 2>&1 && | ||||||
| 	# Output should point to where to resolve conflicts | 	# Output should point to where to resolve conflicts | ||||||
| 	test_i18ngrep "\\.git/NOTES_MERGE_WORKTREE" output && | 	test_grep "\\.git/NOTES_MERGE_WORKTREE" output && | ||||||
| 	# Inspect merge conflicts | 	# Inspect merge conflicts | ||||||
| 	ls .git/NOTES_MERGE_WORKTREE >output_conflicts && | 	ls .git/NOTES_MERGE_WORKTREE >output_conflicts && | ||||||
| 	test_cmp expect_conflicts output_conflicts && | 	test_cmp expect_conflicts output_conflicts && | ||||||
|  | @ -528,7 +528,7 @@ test_expect_success 'redo merge of z into m (== y) with default ("manual") resol | ||||||
| 	git update-ref refs/notes/m refs/notes/y && | 	git update-ref refs/notes/m refs/notes/y && | ||||||
| 	test_must_fail git notes merge z >output 2>&1 && | 	test_must_fail git notes merge z >output 2>&1 && | ||||||
| 	# Output should point to where to resolve conflicts | 	# Output should point to where to resolve conflicts | ||||||
| 	test_i18ngrep "\\.git/NOTES_MERGE_WORKTREE" output && | 	test_grep "\\.git/NOTES_MERGE_WORKTREE" output && | ||||||
| 	# Inspect merge conflicts | 	# Inspect merge conflicts | ||||||
| 	ls .git/NOTES_MERGE_WORKTREE >output_conflicts && | 	ls .git/NOTES_MERGE_WORKTREE >output_conflicts && | ||||||
| 	test_cmp expect_conflicts output_conflicts && | 	test_cmp expect_conflicts output_conflicts && | ||||||
|  | @ -573,9 +573,9 @@ EOF | ||||||
| 	test "$(git rev-parse refs/notes/y)" = "$(git rev-parse NOTES_MERGE_PARTIAL^1)" && | 	test "$(git rev-parse refs/notes/y)" = "$(git rev-parse NOTES_MERGE_PARTIAL^1)" && | ||||||
| 	test "$(git rev-parse refs/notes/m)" != "$(git rev-parse NOTES_MERGE_PARTIAL^1)" && | 	test "$(git rev-parse refs/notes/m)" != "$(git rev-parse NOTES_MERGE_PARTIAL^1)" && | ||||||
| 	# Mention refs/notes/m, and its current and expected value in output | 	# Mention refs/notes/m, and its current and expected value in output | ||||||
| 	test_i18ngrep -q "refs/notes/m" output && | 	test_grep -q "refs/notes/m" output && | ||||||
| 	test_i18ngrep -q "$(git rev-parse refs/notes/m)" output && | 	test_grep -q "$(git rev-parse refs/notes/m)" output && | ||||||
| 	test_i18ngrep -q "$(git rev-parse NOTES_MERGE_PARTIAL^1)" output && | 	test_grep -q "$(git rev-parse NOTES_MERGE_PARTIAL^1)" output && | ||||||
| 	# Verify that other notes refs has not changed (w, x, y and z) | 	# Verify that other notes refs has not changed (w, x, y and z) | ||||||
| 	verify_notes w && | 	verify_notes w && | ||||||
| 	verify_notes x && | 	verify_notes x && | ||||||
|  |  | ||||||
|  | @ -57,7 +57,7 @@ test_expect_success 'merge z into y while mid-merge in another workdir fails' ' | ||||||
| 		cd worktree && | 		cd worktree && | ||||||
| 		git config core.notesRef refs/notes/y && | 		git config core.notesRef refs/notes/y && | ||||||
| 		test_must_fail git notes merge z 2>err && | 		test_must_fail git notes merge z 2>err && | ||||||
| 		test_i18ngrep "a notes merge into refs/notes/y is already in-progress at" err | 		test_grep "a notes merge into refs/notes/y is already in-progress at" err | ||||||
| 	) && | 	) && | ||||||
| 	test_must_fail git -C worktree symbolic-ref NOTES_MERGE_REF | 	test_must_fail git -C worktree symbolic-ref NOTES_MERGE_REF | ||||||
| ' | ' | ||||||
|  | @ -67,7 +67,7 @@ test_expect_success 'merge z into x while mid-merge on y succeeds' ' | ||||||
| 		cd worktree2 && | 		cd worktree2 && | ||||||
| 		git config core.notesRef refs/notes/x && | 		git config core.notesRef refs/notes/x && | ||||||
| 		test_must_fail git notes merge z >out 2>&1 && | 		test_must_fail git notes merge z >out 2>&1 && | ||||||
| 		test_i18ngrep "Automatic notes merge failed" out && | 		test_grep "Automatic notes merge failed" out && | ||||||
| 		grep -v "A notes merge into refs/notes/x is already in-progress in" out | 		grep -v "A notes merge into refs/notes/x is already in-progress in" out | ||||||
| 	) && | 	) && | ||||||
| 	echo "refs/notes/x" >expect && | 	echo "refs/notes/x" >expect && | ||||||
|  |  | ||||||
|  | @ -429,7 +429,7 @@ test_expect_success 'add notes with empty messages' ' | ||||||
| 	git notes add -m "${LF}" \ | 	git notes add -m "${LF}" \ | ||||||
| 		      -m "${MULTI_LF}" \ | 		      -m "${MULTI_LF}" \ | ||||||
| 		      -m "${LF}" >actual 2>&1 && | 		      -m "${LF}" >actual 2>&1 && | ||||||
| 	test_i18ngrep "Removing note for object" actual | 	test_grep "Removing note for object" actual | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'add note by specifying "-C", "--no-stripspace" is the default behavior' ' | test_expect_success 'add note by specifying "-C", "--no-stripspace" is the default behavior' ' | ||||||
|  |  | ||||||
|  | @ -143,8 +143,8 @@ test_expect_success 'Show verbose error when HEAD could not be detached' ' | ||||||
| 	>B && | 	>B && | ||||||
| 	test_when_finished "rm -f B" && | 	test_when_finished "rm -f B" && | ||||||
| 	test_must_fail git rebase topic 2>output.err >output.out && | 	test_must_fail git rebase topic 2>output.err >output.out && | ||||||
| 	test_i18ngrep "The following untracked working tree files would be overwritten by checkout:" output.err && | 	test_grep "The following untracked working tree files would be overwritten by checkout:" output.err && | ||||||
| 	test_i18ngrep B output.err | 	test_grep B output.err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'fail when upstream arg is missing and not on branch' ' | test_expect_success 'fail when upstream arg is missing and not on branch' ' | ||||||
|  | @ -421,7 +421,7 @@ test_expect_success 'refuse to switch to branch checked out elsewhere' ' | ||||||
| 	git checkout main && | 	git checkout main && | ||||||
| 	git worktree add wt && | 	git worktree add wt && | ||||||
| 	test_must_fail git -C wt rebase main main 2>err && | 	test_must_fail git -C wt rebase main main 2>err && | ||||||
| 	test_i18ngrep "already used by worktree at" err | 	test_grep "already used by worktree at" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success MINGW,SYMLINKS_WINDOWS 'rebase when .git/logs is a symlink' ' | test_expect_success MINGW,SYMLINKS_WINDOWS 'rebase when .git/logs is a symlink' ' | ||||||
|  |  | ||||||
|  | @ -171,7 +171,7 @@ test_expect_success '--reapply-cherry-picks' ' | ||||||
|  |  | ||||||
| 	# Regular rebase fails, because the 1-11 commit is deduplicated | 	# Regular rebase fails, because the 1-11 commit is deduplicated | ||||||
| 	test_must_fail git -C repo rebase --merge main 2> err && | 	test_must_fail git -C repo rebase --merge main 2> err && | ||||||
| 	test_i18ngrep "error: could not apply.*add 12 in another branch" err && | 	test_grep "error: could not apply.*add 12 in another branch" err && | ||||||
| 	git -C repo rebase --abort && | 	git -C repo rebase --abort && | ||||||
|  |  | ||||||
| 	# With --reapply-cherry-picks, it works | 	# With --reapply-cherry-picks, it works | ||||||
|  |  | ||||||
|  | @ -108,10 +108,10 @@ test_expect_success 'correct advice upon picking empty commit' ' | ||||||
| 	test_when_finished "git rebase --abort" && | 	test_when_finished "git rebase --abort" && | ||||||
| 	test_must_fail git rebase -i --onto goodbye \ | 	test_must_fail git rebase -i --onto goodbye \ | ||||||
| 		amended-goodbye^ amended-goodbye 2>err && | 		amended-goodbye^ amended-goodbye 2>err && | ||||||
| 	test_i18ngrep "previous cherry-pick is now empty" err && | 	test_grep "previous cherry-pick is now empty" err && | ||||||
| 	test_i18ngrep "git rebase --skip" err && | 	test_grep "git rebase --skip" err && | ||||||
| 	test_must_fail git commit && | 	test_must_fail git commit && | ||||||
| 	test_i18ngrep "git rebase --skip" err | 	test_grep "git rebase --skip" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'correct authorship when committing empty pick' ' | test_expect_success 'correct authorship when committing empty pick' ' | ||||||
|  | @ -131,10 +131,10 @@ test_expect_success 'correct advice upon rewording empty commit' ' | ||||||
| 		test_must_fail env FAKE_LINES="reword 1" git rebase -i \ | 		test_must_fail env FAKE_LINES="reword 1" git rebase -i \ | ||||||
| 			--onto goodbye amended-goodbye^ amended-goodbye 2>err | 			--onto goodbye amended-goodbye^ amended-goodbye 2>err | ||||||
| 	) && | 	) && | ||||||
| 	test_i18ngrep "previous cherry-pick is now empty" err && | 	test_grep "previous cherry-pick is now empty" err && | ||||||
| 	test_i18ngrep "git rebase --skip" err && | 	test_grep "git rebase --skip" err && | ||||||
| 	test_must_fail git commit && | 	test_must_fail git commit && | ||||||
| 	test_i18ngrep "git rebase --skip" err | 	test_grep "git rebase --skip" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'correct advice upon editing empty commit' ' | test_expect_success 'correct advice upon editing empty commit' ' | ||||||
|  | @ -144,10 +144,10 @@ test_expect_success 'correct advice upon editing empty commit' ' | ||||||
| 		test_must_fail env FAKE_LINES="edit 1" git rebase -i \ | 		test_must_fail env FAKE_LINES="edit 1" git rebase -i \ | ||||||
| 			--onto goodbye amended-goodbye^ amended-goodbye 2>err | 			--onto goodbye amended-goodbye^ amended-goodbye 2>err | ||||||
| 	) && | 	) && | ||||||
| 	test_i18ngrep "previous cherry-pick is now empty" err && | 	test_grep "previous cherry-pick is now empty" err && | ||||||
| 	test_i18ngrep "git rebase --skip" err && | 	test_grep "git rebase --skip" err && | ||||||
| 	test_must_fail git commit && | 	test_must_fail git commit && | ||||||
| 	test_i18ngrep "git rebase --skip" err | 	test_grep "git rebase --skip" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'correct advice upon cherry-picking an empty commit during a rebase' ' | test_expect_success 'correct advice upon cherry-picking an empty commit during a rebase' ' | ||||||
|  | @ -157,10 +157,10 @@ test_expect_success 'correct advice upon cherry-picking an empty commit during a | ||||||
| 		test_must_fail env FAKE_LINES="1 exec_git_cherry-pick_amended-goodbye" \ | 		test_must_fail env FAKE_LINES="1 exec_git_cherry-pick_amended-goodbye" \ | ||||||
| 			git rebase -i goodbye^ goodbye 2>err | 			git rebase -i goodbye^ goodbye 2>err | ||||||
| 	) && | 	) && | ||||||
| 	test_i18ngrep "previous cherry-pick is now empty" err && | 	test_grep "previous cherry-pick is now empty" err && | ||||||
| 	test_i18ngrep "git cherry-pick --skip" err && | 	test_grep "git cherry-pick --skip" err && | ||||||
| 	test_must_fail git commit 2>err && | 	test_must_fail git commit 2>err && | ||||||
| 	test_i18ngrep "git cherry-pick --skip" err | 	test_grep "git cherry-pick --skip" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'correct advice upon multi cherry-pick picking an empty commit during a rebase' ' | test_expect_success 'correct advice upon multi cherry-pick picking an empty commit during a rebase' ' | ||||||
|  | @ -170,10 +170,10 @@ test_expect_success 'correct advice upon multi cherry-pick picking an empty comm | ||||||
| 		test_must_fail env FAKE_LINES="1 exec_git_cherry-pick_goodbye_amended-goodbye" \ | 		test_must_fail env FAKE_LINES="1 exec_git_cherry-pick_goodbye_amended-goodbye" \ | ||||||
| 			git rebase -i goodbye^^ goodbye 2>err | 			git rebase -i goodbye^^ goodbye 2>err | ||||||
| 	) && | 	) && | ||||||
| 	test_i18ngrep "previous cherry-pick is now empty" err && | 	test_grep "previous cherry-pick is now empty" err && | ||||||
| 	test_i18ngrep "git cherry-pick --skip" err && | 	test_grep "git cherry-pick --skip" err && | ||||||
| 	test_must_fail git commit 2>err && | 	test_must_fail git commit 2>err && | ||||||
| 	test_i18ngrep "git cherry-pick --skip" err | 	test_grep "git cherry-pick --skip" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'fixup that empties commit fails' ' | test_expect_success 'fixup that empties commit fails' ' | ||||||
|  |  | ||||||
|  | @ -291,9 +291,9 @@ test_expect_success 'abort with error when new base cannot be checked out' ' | ||||||
| 	git rm --cached file1 && | 	git rm --cached file1 && | ||||||
| 	git commit -m "remove file in base" && | 	git commit -m "remove file in base" && | ||||||
| 	test_must_fail git rebase -i primary > output 2>&1 && | 	test_must_fail git rebase -i primary > output 2>&1 && | ||||||
| 	test_i18ngrep "The following untracked working tree files would be overwritten by checkout:" \ | 	test_grep "The following untracked working tree files would be overwritten by checkout:" \ | ||||||
| 		output && | 		output && | ||||||
| 	test_i18ngrep "file1" output && | 	test_grep "file1" output && | ||||||
| 	test_path_is_missing .git/rebase-merge && | 	test_path_is_missing .git/rebase-merge && | ||||||
| 	rm file1 && | 	rm file1 && | ||||||
| 	git reset --hard HEAD^ | 	git reset --hard HEAD^ | ||||||
|  | @ -604,8 +604,8 @@ test_expect_success 'clean error after failed "exec"' ' | ||||||
| 	echo "edited again" > file7 && | 	echo "edited again" > file7 && | ||||||
| 	git add file7 && | 	git add file7 && | ||||||
| 	test_must_fail git rebase --continue 2>error && | 	test_must_fail git rebase --continue 2>error && | ||||||
| 	test_i18ngrep "you have staged changes in your working tree" error && | 	test_grep "you have staged changes in your working tree" error && | ||||||
| 	test_i18ngrep ! "could not open.*for reading" error | 	test_grep ! "could not open.*for reading" error | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'rebase a detached HEAD' ' | test_expect_success 'rebase a detached HEAD' ' | ||||||
|  | @ -956,7 +956,7 @@ test_expect_success 'rebase --exec works without -i ' ' | ||||||
| 	git reset --hard execute && | 	git reset --hard execute && | ||||||
| 	rm -rf exec_output && | 	rm -rf exec_output && | ||||||
| 	EDITOR="echo >invoked_editor" git rebase --exec "echo a line >>exec_output"  HEAD~2 2>actual && | 	EDITOR="echo >invoked_editor" git rebase --exec "echo a line >>exec_output"  HEAD~2 2>actual && | ||||||
| 	test_i18ngrep  "Successfully rebased and updated" actual && | 	test_grep  "Successfully rebased and updated" actual && | ||||||
| 	test_line_count = 2 exec_output && | 	test_line_count = 2 exec_output && | ||||||
| 	test_path_is_missing invoked_editor | 	test_path_is_missing invoked_editor | ||||||
| ' | ' | ||||||
|  | @ -964,7 +964,7 @@ test_expect_success 'rebase --exec works without -i ' ' | ||||||
| test_expect_success 'rebase -i --exec without <CMD>' ' | test_expect_success 'rebase -i --exec without <CMD>' ' | ||||||
| 	git reset --hard execute && | 	git reset --hard execute && | ||||||
| 	test_must_fail git rebase -i --exec 2>actual && | 	test_must_fail git rebase -i --exec 2>actual && | ||||||
| 	test_i18ngrep "requires a value" actual && | 	test_grep "requires a value" actual && | ||||||
| 	git checkout primary | 	git checkout primary | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  | @ -1273,7 +1273,7 @@ test_expect_success 'todo count' ' | ||||||
| 		test_set_editor "$(pwd)/dump-raw.sh" && | 		test_set_editor "$(pwd)/dump-raw.sh" && | ||||||
| 		git rebase -i HEAD~4 >actual | 		git rebase -i HEAD~4 >actual | ||||||
| 	) && | 	) && | ||||||
| 	test_i18ngrep "^# Rebase ..* onto ..* ([0-9]" actual | 	test_grep "^# Rebase ..* onto ..* ([0-9]" actual | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'rebase -i commits that overwrite untracked files (pick)' ' | test_expect_success 'rebase -i commits that overwrite untracked files (pick)' ' | ||||||
|  | @ -1408,7 +1408,7 @@ test_expect_success 'rebase -i respects rebase.missingCommitsCheck = ignore' ' | ||||||
| 		FAKE_LINES="1 2 3 4" git rebase -i --root 2>actual | 		FAKE_LINES="1 2 3 4" git rebase -i --root 2>actual | ||||||
| 	) && | 	) && | ||||||
| 	test D = $(git cat-file commit HEAD | sed -ne \$p) && | 	test D = $(git cat-file commit HEAD | sed -ne \$p) && | ||||||
| 	test_i18ngrep \ | 	test_grep \ | ||||||
| 		"Successfully rebased and updated refs/heads/missing-commit" \ | 		"Successfully rebased and updated refs/heads/missing-commit" \ | ||||||
| 		actual | 		actual | ||||||
| ' | ' | ||||||
|  | @ -1471,7 +1471,7 @@ test_expect_success 'rebase --edit-todo respects rebase.missingCommitsCheck = ig | ||||||
| 		git rebase --continue 2>actual | 		git rebase --continue 2>actual | ||||||
| 	) && | 	) && | ||||||
| 	test D = $(git cat-file commit HEAD | sed -ne \$p) && | 	test D = $(git cat-file commit HEAD | sed -ne \$p) && | ||||||
| 	test_i18ngrep \ | 	test_grep \ | ||||||
| 		"Successfully rebased and updated refs/heads/missing-commit" \ | 		"Successfully rebased and updated refs/heads/missing-commit" \ | ||||||
| 		actual | 		actual | ||||||
| ' | ' | ||||||
|  | @ -1506,7 +1506,7 @@ test_expect_success 'rebase --edit-todo respects rebase.missingCommitsCheck = wa | ||||||
| 		git rebase --continue 2>actual | 		git rebase --continue 2>actual | ||||||
| 	) && | 	) && | ||||||
| 	test D = $(git cat-file commit HEAD | sed -ne \$p) && | 	test D = $(git cat-file commit HEAD | sed -ne \$p) && | ||||||
| 	test_i18ngrep \ | 	test_grep \ | ||||||
| 		"Successfully rebased and updated refs/heads/missing-commit" \ | 		"Successfully rebased and updated refs/heads/missing-commit" \ | ||||||
| 		actual | 		actual | ||||||
| ' | ' | ||||||
|  | @ -1554,7 +1554,7 @@ test_expect_success 'rebase --edit-todo respects rebase.missingCommitsCheck = er | ||||||
| 		git rebase --continue 2>actual | 		git rebase --continue 2>actual | ||||||
| 	) && | 	) && | ||||||
| 	test D = $(git cat-file commit HEAD | sed -ne \$p) && | 	test D = $(git cat-file commit HEAD | sed -ne \$p) && | ||||||
| 	test_i18ngrep \ | 	test_grep \ | ||||||
| 		"Successfully rebased and updated refs/heads/missing-commit" \ | 		"Successfully rebased and updated refs/heads/missing-commit" \ | ||||||
| 		actual | 		actual | ||||||
| ' | ' | ||||||
|  | @ -1614,9 +1614,9 @@ test_expect_success 'static check of bad command' ' | ||||||
| 		set_fake_editor && | 		set_fake_editor && | ||||||
| 		test_must_fail env FAKE_LINES="1 2 3 bad 4 5" \ | 		test_must_fail env FAKE_LINES="1 2 3 bad 4 5" \ | ||||||
| 		git rebase -i --root 2>actual && | 		git rebase -i --root 2>actual && | ||||||
| 		test_i18ngrep "pickled $(git rev-list --oneline -1 primary~1)" \ | 		test_grep "pickled $(git rev-list --oneline -1 primary~1)" \ | ||||||
| 				actual && | 				actual && | ||||||
| 		test_i18ngrep "You can fix this with .git rebase --edit-todo.." \ | 		test_grep "You can fix this with .git rebase --edit-todo.." \ | ||||||
| 				actual && | 				actual && | ||||||
| 		FAKE_LINES="1 2 3 drop 4 5" git rebase --edit-todo | 		FAKE_LINES="1 2 3 drop 4 5" git rebase --edit-todo | ||||||
| 	) && | 	) && | ||||||
|  | @ -1674,8 +1674,8 @@ test_expect_success 'static check of bad SHA-1' ' | ||||||
| 		set_fake_editor && | 		set_fake_editor && | ||||||
| 		test_must_fail env FAKE_LINES="1 2 edit fakesha 3 4 5 #" \ | 		test_must_fail env FAKE_LINES="1 2 edit fakesha 3 4 5 #" \ | ||||||
| 			git rebase -i --root 2>actual && | 			git rebase -i --root 2>actual && | ||||||
| 			test_i18ngrep "edit XXXXXXX False commit" actual && | 			test_grep "edit XXXXXXX False commit" actual && | ||||||
| 			test_i18ngrep "You can fix this with .git rebase --edit-todo.." \ | 			test_grep "You can fix this with .git rebase --edit-todo.." \ | ||||||
| 					actual && | 					actual && | ||||||
| 		FAKE_LINES="1 2 4 5 6" git rebase --edit-todo | 		FAKE_LINES="1 2 4 5 6" git rebase --edit-todo | ||||||
| 	) && | 	) && | ||||||
|  | @ -1702,7 +1702,7 @@ test_expect_success 'rebase -i --gpg-sign=<key-id>' ' | ||||||
| 		FAKE_LINES="edit 1" git rebase -i --gpg-sign="\"S I Gner\"" \ | 		FAKE_LINES="edit 1" git rebase -i --gpg-sign="\"S I Gner\"" \ | ||||||
| 			HEAD^ >out 2>err | 			HEAD^ >out 2>err | ||||||
| 	) && | 	) && | ||||||
| 	test_i18ngrep "$SQ-S\"S I Gner\"$SQ" err | 	test_grep "$SQ-S\"S I Gner\"$SQ" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'rebase -i --gpg-sign=<key-id> overrides commit.gpgSign' ' | test_expect_success 'rebase -i --gpg-sign=<key-id> overrides commit.gpgSign' ' | ||||||
|  | @ -1713,7 +1713,7 @@ test_expect_success 'rebase -i --gpg-sign=<key-id> overrides commit.gpgSign' ' | ||||||
| 		FAKE_LINES="edit 1" git rebase -i --gpg-sign="\"S I Gner\"" \ | 		FAKE_LINES="edit 1" git rebase -i --gpg-sign="\"S I Gner\"" \ | ||||||
| 			HEAD^ >out 2>err | 			HEAD^ >out 2>err | ||||||
| 	) && | 	) && | ||||||
| 	test_i18ngrep "$SQ-S\"S I Gner\"$SQ" err | 	test_grep "$SQ-S\"S I Gner\"$SQ" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'valid author header after --root swap' ' | test_expect_success 'valid author header after --root swap' ' | ||||||
|  | @ -1767,7 +1767,7 @@ test_expect_success 'correct error message for partial commit after empty pick' | ||||||
| 	) && | 	) && | ||||||
| 	echo x >file1 && | 	echo x >file1 && | ||||||
| 	test_must_fail git commit file1 2>err && | 	test_must_fail git commit file1 2>err && | ||||||
| 	test_i18ngrep "cannot do a partial commit during a rebase." err | 	test_grep "cannot do a partial commit during a rebase." err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'correct error message for commit --amend after empty pick' ' | test_expect_success 'correct error message for commit --amend after empty pick' ' | ||||||
|  | @ -1780,13 +1780,13 @@ test_expect_success 'correct error message for commit --amend after empty pick' | ||||||
| 	) && | 	) && | ||||||
| 	echo x>file1 && | 	echo x>file1 && | ||||||
| 	test_must_fail git commit -a --amend 2>err && | 	test_must_fail git commit -a --amend 2>err && | ||||||
| 	test_i18ngrep "middle of a rebase -- cannot amend." err | 	test_grep "middle of a rebase -- cannot amend." err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'todo has correct onto hash' ' | test_expect_success 'todo has correct onto hash' ' | ||||||
| 	GIT_SEQUENCE_EDITOR=cat git rebase -i no-conflict-branch~4 no-conflict-branch >actual && | 	GIT_SEQUENCE_EDITOR=cat git rebase -i no-conflict-branch~4 no-conflict-branch >actual && | ||||||
| 	onto=$(git rev-parse --short HEAD~4) && | 	onto=$(git rev-parse --short HEAD~4) && | ||||||
| 	test_i18ngrep "^# Rebase ..* onto $onto" actual | 	test_grep "^# Rebase ..* onto $onto" actual | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'ORIG_HEAD is updated correctly' ' | test_expect_success 'ORIG_HEAD is updated correctly' ' | ||||||
|  |  | ||||||
|  | @ -33,24 +33,24 @@ test_expect_success 'rebase -m' ' | ||||||
|  |  | ||||||
| test_expect_success 'rebase against main twice' ' | test_expect_success 'rebase against main twice' ' | ||||||
| 	git rebase --apply main >out && | 	git rebase --apply main >out && | ||||||
| 	test_i18ngrep "Current branch topic is up to date" out | 	test_grep "Current branch topic is up to date" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'rebase against main twice with --force' ' | test_expect_success 'rebase against main twice with --force' ' | ||||||
| 	git rebase --force-rebase --apply main >out && | 	git rebase --force-rebase --apply main >out && | ||||||
| 	test_i18ngrep "Current branch topic is up to date, rebase forced" out | 	test_grep "Current branch topic is up to date, rebase forced" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'rebase against main twice from another branch' ' | test_expect_success 'rebase against main twice from another branch' ' | ||||||
| 	git checkout topic^ && | 	git checkout topic^ && | ||||||
| 	git rebase --apply main topic >out && | 	git rebase --apply main topic >out && | ||||||
| 	test_i18ngrep "Current branch topic is up to date" out | 	test_grep "Current branch topic is up to date" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'rebase fast-forward to main' ' | test_expect_success 'rebase fast-forward to main' ' | ||||||
| 	git checkout topic^ && | 	git checkout topic^ && | ||||||
| 	git rebase --apply topic >out && | 	git rebase --apply topic >out && | ||||||
| 	test_i18ngrep "Fast-forwarded HEAD to topic" out | 	test_grep "Fast-forwarded HEAD to topic" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'rebase --stat' ' | test_expect_success 'rebase --stat' ' | ||||||
|  | @ -75,14 +75,14 @@ test_expect_success 'rebase -n overrides config rebase.stat config' ' | ||||||
|  |  | ||||||
| test_expect_success 'rebase --onto outputs the invalid ref' ' | test_expect_success 'rebase --onto outputs the invalid ref' ' | ||||||
| 	test_must_fail git rebase --onto invalid-ref HEAD HEAD 2>err && | 	test_must_fail git rebase --onto invalid-ref HEAD HEAD 2>err && | ||||||
| 	test_i18ngrep "invalid-ref" err | 	test_grep "invalid-ref" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'error out early upon -C<n> or --whitespace=<bad>' ' | test_expect_success 'error out early upon -C<n> or --whitespace=<bad>' ' | ||||||
| 	test_must_fail git rebase -Cnot-a-number HEAD 2>err && | 	test_must_fail git rebase -Cnot-a-number HEAD 2>err && | ||||||
| 	test_i18ngrep "numerical value" err && | 	test_grep "numerical value" err && | ||||||
| 	test_must_fail git rebase --whitespace=bad HEAD 2>err && | 	test_must_fail git rebase --whitespace=bad HEAD 2>err && | ||||||
| 	test_i18ngrep "Invalid whitespace option" err | 	test_grep "Invalid whitespace option" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| write_reflog_expect () { | write_reflog_expect () { | ||||||
|  | @ -251,8 +251,8 @@ test_expect_success 'rebase -i onto unrelated history' ' | ||||||
| 	git -C unrelated remote add -f origin "$PWD" && | 	git -C unrelated remote add -f origin "$PWD" && | ||||||
| 	git -C unrelated branch --set-upstream-to=origin/main && | 	git -C unrelated branch --set-upstream-to=origin/main && | ||||||
| 	git -C unrelated -c core.editor=true rebase -i -v --stat >actual && | 	git -C unrelated -c core.editor=true rebase -i -v --stat >actual && | ||||||
| 	test_i18ngrep "Changes to " actual && | 	test_grep "Changes to " actual && | ||||||
| 	test_i18ngrep "5 files changed" actual | 	test_grep "5 files changed" actual | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_done | test_done | ||||||
|  |  | ||||||
|  | @ -182,8 +182,8 @@ test_expect_success '--skip after failed fixup cleans commit message' ' | ||||||
|  |  | ||||||
| 	: Final squash failed, but there was still a squash && | 	: Final squash failed, but there was still a squash && | ||||||
| 	head -n1 .git/copy.txt >first-line && | 	head -n1 .git/copy.txt >first-line && | ||||||
| 	test_i18ngrep "# This is a combination of 3 commits" first-line && | 	test_grep "# This is a combination of 3 commits" first-line && | ||||||
| 	test_i18ngrep "# This is the commit message #3:" .git/copy.txt | 	test_grep "# This is the commit message #3:" .git/copy.txt | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'setup rerere database' ' | test_expect_success 'setup rerere database' ' | ||||||
|  | @ -294,7 +294,7 @@ test_expect_success '--reschedule-failed-exec' ' | ||||||
| 	test_must_fail git -c rebase.rescheduleFailedExec=true \ | 	test_must_fail git -c rebase.rescheduleFailedExec=true \ | ||||||
| 		rebase -x false HEAD^ 2>err && | 		rebase -x false HEAD^ 2>err && | ||||||
| 	grep "^exec false" .git/rebase-merge/git-rebase-todo && | 	grep "^exec false" .git/rebase-merge/git-rebase-todo && | ||||||
| 	test_i18ngrep "has been rescheduled" err | 	test_grep "has been rescheduled" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'rebase.rescheduleFailedExec only affects `rebase -i`' ' | test_expect_success 'rebase.rescheduleFailedExec only affects `rebase -i`' ' | ||||||
|  |  | ||||||
|  | @ -84,7 +84,7 @@ test_expect_success 'git rebase --fork-point with ambigous refname' ' | ||||||
|  |  | ||||||
| test_expect_success '--fork-point and --root both given' ' | test_expect_success '--fork-point and --root both given' ' | ||||||
| 	test_must_fail git rebase --fork-point --root 2>err && | 	test_must_fail git rebase --fork-point --root 2>err && | ||||||
| 	test_i18ngrep "cannot be used together" err | 	test_grep "cannot be used together" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'rebase.forkPoint set to false' ' | test_expect_success 'rebase.forkPoint set to false' ' | ||||||
|  |  | ||||||
|  | @ -43,7 +43,7 @@ test_expect_success 'cherry-pick --nonsense' ' | ||||||
| 	git diff --exit-code HEAD && | 	git diff --exit-code HEAD && | ||||||
| 	test_must_fail git cherry-pick --nonsense 2>msg && | 	test_must_fail git cherry-pick --nonsense 2>msg && | ||||||
| 	git diff --exit-code HEAD "$pos" && | 	git diff --exit-code HEAD "$pos" && | ||||||
| 	test_i18ngrep "[Uu]sage:" msg | 	test_grep "[Uu]sage:" msg | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'revert --nonsense' ' | test_expect_success 'revert --nonsense' ' | ||||||
|  | @ -52,7 +52,7 @@ test_expect_success 'revert --nonsense' ' | ||||||
| 	git diff --exit-code HEAD && | 	git diff --exit-code HEAD && | ||||||
| 	test_must_fail git revert --nonsense 2>msg && | 	test_must_fail git revert --nonsense 2>msg && | ||||||
| 	git diff --exit-code HEAD "$pos" && | 	git diff --exit-code HEAD "$pos" && | ||||||
| 	test_i18ngrep "[Uu]sage:" msg | 	test_grep "[Uu]sage:" msg | ||||||
| ' | ' | ||||||
|  |  | ||||||
| # the following two test cherry-pick and revert with renames | # the following two test cherry-pick and revert with renames | ||||||
|  | @ -99,7 +99,7 @@ test_expect_success 'revert forbidden on dirty working tree' ' | ||||||
| 	echo content >extra_file && | 	echo content >extra_file && | ||||||
| 	git add extra_file && | 	git add extra_file && | ||||||
| 	test_must_fail git revert HEAD 2>errors && | 	test_must_fail git revert HEAD 2>errors && | ||||||
| 	test_i18ngrep "your local changes would be overwritten by " errors | 	test_grep "your local changes would be overwritten by " errors | ||||||
|  |  | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  |  | ||||||
|  | @ -177,7 +177,7 @@ test_expect_success 'partial commit of cherry-pick fails' ' | ||||||
| 	git add foo && | 	git add foo && | ||||||
| 	test_must_fail git commit foo 2>err && | 	test_must_fail git commit foo 2>err && | ||||||
|  |  | ||||||
| 	test_i18ngrep "cannot do a partial commit during a cherry-pick." err | 	test_grep "cannot do a partial commit during a cherry-pick." err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'commit --amend of cherry-pick fails' ' | test_expect_success 'commit --amend of cherry-pick fails' ' | ||||||
|  | @ -188,7 +188,7 @@ test_expect_success 'commit --amend of cherry-pick fails' ' | ||||||
| 	git add foo && | 	git add foo && | ||||||
| 	test_must_fail git commit --amend 2>err && | 	test_must_fail git commit --amend 2>err && | ||||||
|  |  | ||||||
| 	test_i18ngrep "in the middle of a cherry-pick -- cannot amend." err | 	test_grep "in the middle of a cherry-pick -- cannot amend." err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'successful final commit clears cherry-pick state' ' | test_expect_success 'successful final commit clears cherry-pick state' ' | ||||||
|  | @ -498,7 +498,7 @@ test_expect_success \ | ||||||
| test_expect_success 'failed cherry-pick does not forget -s' ' | test_expect_success 'failed cherry-pick does not forget -s' ' | ||||||
| 	pristine_detach initial && | 	pristine_detach initial && | ||||||
| 	test_must_fail git cherry-pick -s picked && | 	test_must_fail git cherry-pick -s picked && | ||||||
| 	test_i18ngrep -e "Signed-off-by" .git/MERGE_MSG | 	test_grep -e "Signed-off-by" .git/MERGE_MSG | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'commit after failed cherry-pick does not add duplicated -s' ' | test_expect_success 'commit after failed cherry-pick does not add duplicated -s' ' | ||||||
|  | @ -563,7 +563,7 @@ test_expect_success 'cherry-pick preserves sparse-checkout' ' | ||||||
| 	echo /unrelated >.git/info/sparse-checkout && | 	echo /unrelated >.git/info/sparse-checkout && | ||||||
| 	git read-tree --reset -u HEAD && | 	git read-tree --reset -u HEAD && | ||||||
| 	test_must_fail git cherry-pick -Xours picked>actual && | 	test_must_fail git cherry-pick -Xours picked>actual && | ||||||
| 	test_i18ngrep ! "Changes not staged for commit:" actual | 	test_grep ! "Changes not staged for commit:" actual | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'cherry-pick --continue remembers --keep-redundant-commits' ' | test_expect_success 'cherry-pick --continue remembers --keep-redundant-commits' ' | ||||||
|  |  | ||||||
|  | @ -154,7 +154,7 @@ test_expect_success 'skip "empty" commit' ' | ||||||
| 	pristine_detach picked && | 	pristine_detach picked && | ||||||
| 	test_commit dummy foo d && | 	test_commit dummy foo d && | ||||||
| 	test_must_fail git cherry-pick anotherpick 2>err && | 	test_must_fail git cherry-pick anotherpick 2>err && | ||||||
| 	test_i18ngrep "git cherry-pick --skip" err && | 	test_grep "git cherry-pick --skip" err && | ||||||
| 	git cherry-pick --skip && | 	git cherry-pick --skip && | ||||||
| 	test_cmp_rev dummy HEAD | 	test_cmp_rev dummy HEAD | ||||||
| ' | ' | ||||||
|  | @ -314,7 +314,7 @@ test_expect_success '--abort does not unsafely change HEAD' ' | ||||||
| 	git reset --hard base && | 	git reset --hard base && | ||||||
| 	test_must_fail git cherry-pick picked anotherpick && | 	test_must_fail git cherry-pick picked anotherpick && | ||||||
| 	git cherry-pick --abort 2>actual && | 	git cherry-pick --abort 2>actual && | ||||||
| 	test_i18ngrep "You seem to have moved HEAD" actual && | 	test_grep "You seem to have moved HEAD" actual && | ||||||
| 	test_cmp_rev base HEAD | 	test_cmp_rev base HEAD | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  | @ -520,7 +520,7 @@ test_expect_success '--continue asks for help after resolving patch to nil' ' | ||||||
| 	test_cmp_rev unrelatedpick CHERRY_PICK_HEAD && | 	test_cmp_rev unrelatedpick CHERRY_PICK_HEAD && | ||||||
| 	git checkout HEAD -- unrelated && | 	git checkout HEAD -- unrelated && | ||||||
| 	test_must_fail git cherry-pick --continue 2>msg && | 	test_must_fail git cherry-pick --continue 2>msg && | ||||||
| 	test_i18ngrep "The previous cherry-pick is now empty" msg | 	test_grep "The previous cherry-pick is now empty" msg | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'follow advice and skip nil patch' ' | test_expect_success 'follow advice and skip nil patch' ' | ||||||
|  |  | ||||||
|  | @ -276,7 +276,7 @@ test_expect_success 'Resolving by removal is not a warning-worthy event' ' | ||||||
| 	blob=$(echo blob | git hash-object -w --stdin) && | 	blob=$(echo blob | git hash-object -w --stdin) && | ||||||
| 	printf "100644 $blob %d\tblob\n" 1 2 3 | git update-index --index-info && | 	printf "100644 $blob %d\tblob\n" 1 2 3 | git update-index --index-info && | ||||||
| 	git rm blob >msg 2>&1 && | 	git rm blob >msg 2>&1 && | ||||||
| 	test_i18ngrep ! "needs merge" msg && | 	test_grep ! "needs merge" msg && | ||||||
| 	test_must_fail git ls-files -s --error-unmatch blob | 	test_must_fail git ls-files -s --error-unmatch blob | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  | @ -631,7 +631,7 @@ test_expect_success 'rm of a populated submodule with a .git directory migrates | ||||||
| 	test_path_is_missing submod/.git && | 	test_path_is_missing submod/.git && | ||||||
| 	git status -s -uno --ignore-submodules=none >actual && | 	git status -s -uno --ignore-submodules=none >actual && | ||||||
| 	test_file_not_empty actual && | 	test_file_not_empty actual && | ||||||
| 	test_i18ngrep Migrating output.err | 	test_grep Migrating output.err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| cat >expect.deepmodified <<EOF | cat >expect.deepmodified <<EOF | ||||||
|  | @ -722,7 +722,7 @@ test_expect_success "rm absorbs submodule's nested .git directory" ' | ||||||
| 	test_path_is_missing submod/subsubmod/.git && | 	test_path_is_missing submod/subsubmod/.git && | ||||||
| 	git status -s -uno --ignore-submodules=none >actual && | 	git status -s -uno --ignore-submodules=none >actual && | ||||||
| 	test_file_not_empty actual && | 	test_file_not_empty actual && | ||||||
| 	test_i18ngrep Migrating output.err | 	test_grep Migrating output.err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'checking out a commit after submodule removal needs manual updates' ' | test_expect_success 'checking out a commit after submodule removal needs manual updates' ' | ||||||
|  | @ -731,7 +731,7 @@ test_expect_success 'checking out a commit after submodule removal needs manual | ||||||
| 	git submodule update && | 	git submodule update && | ||||||
| 	git checkout -q HEAD^ && | 	git checkout -q HEAD^ && | ||||||
| 	git checkout -q main 2>actual && | 	git checkout -q main 2>actual && | ||||||
| 	test_i18ngrep "^warning: unable to rmdir '\''submod'\'':" actual && | 	test_grep "^warning: unable to rmdir '\''submod'\'':" actual && | ||||||
| 	git status -s submod >actual && | 	git status -s submod >actual && | ||||||
| 	echo "?? submod/" >expected && | 	echo "?? submod/" >expected && | ||||||
| 	test_cmp expected actual && | 	test_cmp expected actual && | ||||||
|  |  | ||||||
|  | @ -67,14 +67,14 @@ test_expect_success 'error conditions' ' | ||||||
| 	echo fileA.t >list && | 	echo fileA.t >list && | ||||||
|  |  | ||||||
| 	test_must_fail git rm --pathspec-from-file=list -- fileA.t 2>err && | 	test_must_fail git rm --pathspec-from-file=list -- fileA.t 2>err && | ||||||
| 	test_i18ngrep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err && | 	test_grep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err && | ||||||
|  |  | ||||||
| 	test_must_fail git rm --pathspec-file-nul 2>err && | 	test_must_fail git rm --pathspec-file-nul 2>err && | ||||||
| 	test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err && | 	test_grep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err && | ||||||
|  |  | ||||||
| 	>empty_list && | 	>empty_list && | ||||||
| 	test_must_fail git rm --pathspec-from-file=empty_list 2>err && | 	test_must_fail git rm --pathspec-from-file=empty_list 2>err && | ||||||
| 	test_i18ngrep -e "No pathspec was given. Which files should I remove?" err | 	test_grep -e "No pathspec was given. Which files should I remove?" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_done | test_done | ||||||
|  |  | ||||||
|  | @ -438,7 +438,7 @@ test_expect_success 'git add --chmod fails with non regular files (but updates t | ||||||
| 	test_ln_s_add foo foo3 && | 	test_ln_s_add foo foo3 && | ||||||
| 	touch foo4 && | 	touch foo4 && | ||||||
| 	test_must_fail git add --chmod=+x foo3 foo4 2>stderr && | 	test_must_fail git add --chmod=+x foo3 foo4 2>stderr && | ||||||
| 	test_i18ngrep "cannot chmod +x .foo3." stderr && | 	test_grep "cannot chmod +x .foo3." stderr && | ||||||
| 	test_mode_in_index 120000 foo3 && | 	test_mode_in_index 120000 foo3 && | ||||||
| 	test_mode_in_index 100755 foo4 | 	test_mode_in_index 100755 foo4 | ||||||
| ' | ' | ||||||
|  | @ -455,12 +455,12 @@ test_expect_success 'git add --chmod --dry-run reports error for non regular fil | ||||||
| 	git reset --hard && | 	git reset --hard && | ||||||
| 	test_ln_s_add foo foo4 && | 	test_ln_s_add foo foo4 && | ||||||
| 	test_must_fail git add --chmod=+x --dry-run foo4 2>stderr && | 	test_must_fail git add --chmod=+x --dry-run foo4 2>stderr && | ||||||
| 	test_i18ngrep "cannot chmod +x .foo4." stderr | 	test_grep "cannot chmod +x .foo4." stderr | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'git add --chmod --dry-run reports error for unmatched pathspec' ' | test_expect_success 'git add --chmod --dry-run reports error for unmatched pathspec' ' | ||||||
| 	test_must_fail git add --chmod=+x --dry-run nonexistent 2>stderr && | 	test_must_fail git add --chmod=+x --dry-run nonexistent 2>stderr && | ||||||
| 	test_i18ngrep "pathspec .nonexistent. did not match any files" stderr | 	test_grep "pathspec .nonexistent. did not match any files" stderr | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'no file status change if no pathspec is given' ' | test_expect_success 'no file status change if no pathspec is given' ' | ||||||
|  |  | ||||||
|  | @ -335,12 +335,12 @@ test_expect_success 'different prompts for mode change/deleted' ' | ||||||
| test_expect_success 'correct message when there is nothing to do' ' | test_expect_success 'correct message when there is nothing to do' ' | ||||||
| 	git reset --hard && | 	git reset --hard && | ||||||
| 	git add -p 2>err && | 	git add -p 2>err && | ||||||
| 	test_i18ngrep "No changes" err && | 	test_grep "No changes" err && | ||||||
| 	printf "\\0123" >binary && | 	printf "\\0123" >binary && | ||||||
| 	git add binary && | 	git add binary && | ||||||
| 	printf "\\0abc" >binary && | 	printf "\\0abc" >binary && | ||||||
| 	git add -p 2>err && | 	git add -p 2>err && | ||||||
| 	test_i18ngrep "Only binary files changed" err | 	test_grep "Only binary files changed" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'setup again' ' | test_expect_success 'setup again' ' | ||||||
|  | @ -497,7 +497,7 @@ test_expect_success 'adding an empty file' ' | ||||||
|  |  | ||||||
| 		echo y | git checkout -p added-file -- >actual && | 		echo y | git checkout -p added-file -- >actual && | ||||||
| 		test_path_is_file empty && | 		test_path_is_file empty && | ||||||
| 		test_i18ngrep "Apply addition to index and worktree" actual | 		test_grep "Apply addition to index and worktree" actual | ||||||
| 	) | 	) | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  | @ -838,7 +838,7 @@ test_expect_success 'diff.algorithm is passed to `git diff-files`' ' | ||||||
| 	git add file && | 	git add file && | ||||||
| 	echo changed >file && | 	echo changed >file && | ||||||
| 	test_must_fail git -c diff.algorithm=bogus add -p 2>err && | 	test_must_fail git -c diff.algorithm=bogus add -p 2>err && | ||||||
| 	test_i18ngrep "error: option diff-algorithm accepts " err | 	test_grep "error: option diff-algorithm accepts " err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'patch-mode via -i prompts for files' ' | test_expect_success 'patch-mode via -i prompts for files' ' | ||||||
|  |  | ||||||
|  | @ -138,23 +138,23 @@ test_expect_success 'error conditions' ' | ||||||
| 	>empty_list && | 	>empty_list && | ||||||
|  |  | ||||||
| 	test_must_fail git add --pathspec-from-file=list --interactive 2>err && | 	test_must_fail git add --pathspec-from-file=list --interactive 2>err && | ||||||
| 	test_i18ngrep -e "options .--pathspec-from-file. and .--interactive/--patch. cannot be used together" err && | 	test_grep -e "options .--pathspec-from-file. and .--interactive/--patch. cannot be used together" err && | ||||||
|  |  | ||||||
| 	test_must_fail git add --pathspec-from-file=list --patch 2>err && | 	test_must_fail git add --pathspec-from-file=list --patch 2>err && | ||||||
| 	test_i18ngrep -e "options .--pathspec-from-file. and .--interactive/--patch. cannot be used together" err && | 	test_grep -e "options .--pathspec-from-file. and .--interactive/--patch. cannot be used together" err && | ||||||
|  |  | ||||||
| 	test_must_fail git add --pathspec-from-file=list --edit 2>err && | 	test_must_fail git add --pathspec-from-file=list --edit 2>err && | ||||||
| 	test_i18ngrep -e "options .--pathspec-from-file. and .--edit. cannot be used together" err && | 	test_grep -e "options .--pathspec-from-file. and .--edit. cannot be used together" err && | ||||||
|  |  | ||||||
| 	test_must_fail git add --pathspec-from-file=list -- fileA.t 2>err && | 	test_must_fail git add --pathspec-from-file=list -- fileA.t 2>err && | ||||||
| 	test_i18ngrep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err && | 	test_grep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err && | ||||||
|  |  | ||||||
| 	test_must_fail git add --pathspec-file-nul 2>err && | 	test_must_fail git add --pathspec-file-nul 2>err && | ||||||
| 	test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err && | 	test_grep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err && | ||||||
|  |  | ||||||
| 	# This case succeeds, but still prints to stderr | 	# This case succeeds, but still prints to stderr | ||||||
| 	git add --pathspec-from-file=empty_list 2>err && | 	git add --pathspec-from-file=empty_list 2>err && | ||||||
| 	test_i18ngrep -e "Nothing specified, nothing added." err | 	test_grep -e "Nothing specified, nothing added." err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_done | test_done | ||||||
|  |  | ||||||
|  | @ -45,7 +45,7 @@ test_expect_success 'UTF-8 invalid characters refused' ' | ||||||
| 	printf "Commit message\n\nInvalid surrogate:\355\240\200\n" \ | 	printf "Commit message\n\nInvalid surrogate:\355\240\200\n" \ | ||||||
| 		>"$HOME/invalid" && | 		>"$HOME/invalid" && | ||||||
| 	git commit -a -F "$HOME/invalid" 2>"$HOME"/stderr && | 	git commit -a -F "$HOME/invalid" 2>"$HOME"/stderr && | ||||||
| 	test_i18ngrep "did not conform" "$HOME"/stderr | 	test_grep "did not conform" "$HOME"/stderr | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'UTF-8 overlong sequences rejected' ' | test_expect_success 'UTF-8 overlong sequences rejected' ' | ||||||
|  | @ -55,7 +55,7 @@ test_expect_success 'UTF-8 overlong sequences rejected' ' | ||||||
| 	printf "\340\202\251ommit message\n\nThis is not a space:\300\240\n" \ | 	printf "\340\202\251ommit message\n\nThis is not a space:\300\240\n" \ | ||||||
| 		>"$HOME/invalid" && | 		>"$HOME/invalid" && | ||||||
| 	git commit -a -F "$HOME/invalid" 2>"$HOME"/stderr && | 	git commit -a -F "$HOME/invalid" 2>"$HOME"/stderr && | ||||||
| 	test_i18ngrep "did not conform" "$HOME"/stderr | 	test_grep "did not conform" "$HOME"/stderr | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'UTF-8 non-characters refused' ' | test_expect_success 'UTF-8 non-characters refused' ' | ||||||
|  | @ -64,7 +64,7 @@ test_expect_success 'UTF-8 non-characters refused' ' | ||||||
| 	printf "Commit message\n\nNon-character:\364\217\277\276\n" \ | 	printf "Commit message\n\nNon-character:\364\217\277\276\n" \ | ||||||
| 		>"$HOME/invalid" && | 		>"$HOME/invalid" && | ||||||
| 	git commit -a -F "$HOME/invalid" 2>"$HOME"/stderr && | 	git commit -a -F "$HOME/invalid" 2>"$HOME"/stderr && | ||||||
| 	test_i18ngrep "did not conform" "$HOME"/stderr | 	test_grep "did not conform" "$HOME"/stderr | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'UTF-8 non-characters refused' ' | test_expect_success 'UTF-8 non-characters refused' ' | ||||||
|  | @ -73,7 +73,7 @@ test_expect_success 'UTF-8 non-characters refused' ' | ||||||
| 	printf "Commit message\n\nNon-character:\357\267\220\n" \ | 	printf "Commit message\n\nNon-character:\357\267\220\n" \ | ||||||
| 		>"$HOME/invalid" && | 		>"$HOME/invalid" && | ||||||
| 	git commit -a -F "$HOME/invalid" 2>"$HOME"/stderr && | 	git commit -a -F "$HOME/invalid" 2>"$HOME"/stderr && | ||||||
| 	test_i18ngrep "did not conform" "$HOME"/stderr | 	test_grep "did not conform" "$HOME"/stderr | ||||||
| ' | ' | ||||||
|  |  | ||||||
| for H in ISO8859-1 eucJP ISO-2022-JP | for H in ISO8859-1 eucJP ISO-2022-JP | ||||||
|  |  | ||||||
|  | @ -298,7 +298,7 @@ test_expect_success 'am --no-utf8 (U/L)' ' | ||||||
|  |  | ||||||
| 	# commit-tree will warn that the commit message does not contain valid UTF-8 | 	# commit-tree will warn that the commit message does not contain valid UTF-8 | ||||||
| 	# as mailinfo did not convert it | 	# as mailinfo did not convert it | ||||||
| 	test_i18ngrep "did not conform" err && | 	test_grep "did not conform" err && | ||||||
|  |  | ||||||
| 	check_encoding 2 | 	check_encoding 2 | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  | @ -395,7 +395,7 @@ test_expect_success 'stash --staged' ' | ||||||
|  |  | ||||||
| test_expect_success 'dont assume push with non-option args' ' | test_expect_success 'dont assume push with non-option args' ' | ||||||
| 	test_must_fail git stash -q drop 2>err && | 	test_must_fail git stash -q drop 2>err && | ||||||
| 	test_i18ngrep -e "subcommand wasn'\''t specified; '\''push'\'' can'\''t be assumed due to unexpected token '\''drop'\''" err | 	test_grep -e "subcommand wasn'\''t specified; '\''push'\'' can'\''t be assumed due to unexpected token '\''drop'\''" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'stash --invalid-option' ' | test_expect_success 'stash --invalid-option' ' | ||||||
|  | @ -596,7 +596,7 @@ test_expect_success 'giving too many ref arguments does not modify files' ' | ||||||
| 	for type in apply pop "branch stash-branch" | 	for type in apply pop "branch stash-branch" | ||||||
| 	do | 	do | ||||||
| 		test_must_fail git stash $type stash@{0} stash@{1} 2>err && | 		test_must_fail git stash $type stash@{0} stash@{1} 2>err && | ||||||
| 		test_i18ngrep "Too many revisions" err && | 		test_grep "Too many revisions" err && | ||||||
| 		test 123456789 = $(test-tool chmtime -g file2) || return 1 | 		test 123456789 = $(test-tool chmtime -g file2) || return 1 | ||||||
| 	done | 	done | ||||||
| ' | ' | ||||||
|  | @ -604,14 +604,14 @@ test_expect_success 'giving too many ref arguments does not modify files' ' | ||||||
| test_expect_success 'drop: too many arguments errors out (does nothing)' ' | test_expect_success 'drop: too many arguments errors out (does nothing)' ' | ||||||
| 	git stash list >expect && | 	git stash list >expect && | ||||||
| 	test_must_fail git stash drop stash@{0} stash@{1} 2>err && | 	test_must_fail git stash drop stash@{0} stash@{1} 2>err && | ||||||
| 	test_i18ngrep "Too many revisions" err && | 	test_grep "Too many revisions" err && | ||||||
| 	git stash list >actual && | 	git stash list >actual && | ||||||
| 	test_cmp expect actual | 	test_cmp expect actual | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'show: too many arguments errors out (does nothing)' ' | test_expect_success 'show: too many arguments errors out (does nothing)' ' | ||||||
| 	test_must_fail git stash show stash@{0} stash@{1} 2>err 1>out && | 	test_must_fail git stash show stash@{0} stash@{1} 2>err 1>out && | ||||||
| 	test_i18ngrep "Too many revisions" err && | 	test_grep "Too many revisions" err && | ||||||
| 	test_must_be_empty out | 	test_must_be_empty out | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  | @ -654,7 +654,7 @@ test_expect_success 'stash branch - stashes on stack, stash-like argument' ' | ||||||
|  |  | ||||||
| test_expect_success 'stash branch complains with no arguments' ' | test_expect_success 'stash branch complains with no arguments' ' | ||||||
| 	test_must_fail git stash branch 2>err && | 	test_must_fail git stash branch 2>err && | ||||||
| 	test_i18ngrep "No branch name specified" err | 	test_grep "No branch name specified" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'stash show format defaults to --stat' ' | test_expect_success 'stash show format defaults to --stat' ' | ||||||
|  |  | ||||||
|  | @ -404,7 +404,7 @@ test_expect_success 'stash show --include-untracked errors on duplicate files' ' | ||||||
| 	) && | 	) && | ||||||
| 	w_commit=$(git commit-tree -p HEAD -p "$i_commit" -p "$u_commit" -m "WIP on any-branch" "$tree") && | 	w_commit=$(git commit-tree -p HEAD -p "$i_commit" -p "$u_commit" -m "WIP on any-branch" "$tree") && | ||||||
| 	test_must_fail git stash show --include-untracked "$w_commit" 2>err && | 	test_must_fail git stash show --include-untracked "$w_commit" 2>err && | ||||||
| 	test_i18ngrep "worktree and untracked commit have duplicate entries: tracked" err | 	test_grep "worktree and untracked commit have duplicate entries: tracked" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'stash show --{include,only}-untracked on stashes without untracked entries' ' | test_expect_success 'stash show --{include,only}-untracked on stashes without untracked entries' ' | ||||||
|  |  | ||||||
|  | @ -88,13 +88,13 @@ test_expect_success 'error conditions' ' | ||||||
| 	echo fileA.t >list && | 	echo fileA.t >list && | ||||||
|  |  | ||||||
| 	test_must_fail git stash push --pathspec-from-file=list --patch 2>err && | 	test_must_fail git stash push --pathspec-from-file=list --patch 2>err && | ||||||
| 	test_i18ngrep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err && | 	test_grep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err && | ||||||
|  |  | ||||||
| 	test_must_fail git stash push --pathspec-from-file=list -- fileA.t 2>err && | 	test_must_fail git stash push --pathspec-from-file=list -- fileA.t 2>err && | ||||||
| 	test_i18ngrep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err && | 	test_grep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err && | ||||||
|  |  | ||||||
| 	test_must_fail git stash push --pathspec-file-nul 2>err && | 	test_must_fail git stash push --pathspec-file-nul 2>err && | ||||||
| 	test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err | 	test_grep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_done | test_done | ||||||
|  |  | ||||||
|  | @ -135,25 +135,25 @@ test_expect_success 'favour same basenames over different ones' ' | ||||||
| 	mkdir subdir && | 	mkdir subdir && | ||||||
| 	git mv another-path subdir/path1 && | 	git mv another-path subdir/path1 && | ||||||
| 	git status >out && | 	git status >out && | ||||||
| 	test_i18ngrep "renamed: .*path1 -> subdir/path1" out | 	test_grep "renamed: .*path1 -> subdir/path1" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'test diff.renames=true for git status' ' | test_expect_success 'test diff.renames=true for git status' ' | ||||||
| 	git -c diff.renames=true status >out && | 	git -c diff.renames=true status >out && | ||||||
| 	test_i18ngrep "renamed: .*path1 -> subdir/path1" out | 	test_grep "renamed: .*path1 -> subdir/path1" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'test diff.renames=false for git status' ' | test_expect_success 'test diff.renames=false for git status' ' | ||||||
| 	git -c diff.renames=false status >out && | 	git -c diff.renames=false status >out && | ||||||
| 	test_i18ngrep ! "renamed: .*path1 -> subdir/path1" out && | 	test_grep ! "renamed: .*path1 -> subdir/path1" out && | ||||||
| 	test_i18ngrep "new file: .*subdir/path1" out && | 	test_grep "new file: .*subdir/path1" out && | ||||||
| 	test_i18ngrep "deleted: .*[^/]path1" out | 	test_grep "deleted: .*[^/]path1" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'favour same basenames even with minor differences' ' | test_expect_success 'favour same basenames even with minor differences' ' | ||||||
| 	git show HEAD:path1 | sed "s/15/16/" > subdir/path1 && | 	git show HEAD:path1 | sed "s/15/16/" > subdir/path1 && | ||||||
| 	git status >out && | 	git status >out && | ||||||
| 	test_i18ngrep "renamed: .*path1 -> subdir/path1" out | 	test_grep "renamed: .*path1 -> subdir/path1" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'two files with same basename and same content' ' | test_expect_success 'two files with same basename and same content' ' | ||||||
|  | @ -165,7 +165,7 @@ test_expect_success 'two files with same basename and same content' ' | ||||||
| 	git commit -m 2 && | 	git commit -m 2 && | ||||||
| 	git mv dir other-dir && | 	git mv dir other-dir && | ||||||
| 	git status >out && | 	git status >out && | ||||||
| 	test_i18ngrep "renamed: .*dir/A/file -> other-dir/A/file" out | 	test_grep "renamed: .*dir/A/file -> other-dir/A/file" out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'setup for many rename source candidates' ' | test_expect_success 'setup for many rename source candidates' ' | ||||||
|  | @ -202,9 +202,9 @@ test_expect_success 'rename pretty print with nothing in common' ' | ||||||
| 	git mv a/b/c c/b/a && | 	git mv a/b/c c/b/a && | ||||||
| 	git commit -m "a/b/c -> c/b/a" && | 	git commit -m "a/b/c -> c/b/a" && | ||||||
| 	git diff -M --summary HEAD^ HEAD >output && | 	git diff -M --summary HEAD^ HEAD >output && | ||||||
| 	test_i18ngrep " a/b/c => c/b/a " output && | 	test_grep " a/b/c => c/b/a " output && | ||||||
| 	git diff -M --stat HEAD^ HEAD >output && | 	git diff -M --stat HEAD^ HEAD >output && | ||||||
| 	test_i18ngrep " a/b/c => c/b/a " output | 	test_grep " a/b/c => c/b/a " output | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'rename pretty print with common prefix' ' | test_expect_success 'rename pretty print with common prefix' ' | ||||||
|  | @ -212,9 +212,9 @@ test_expect_success 'rename pretty print with common prefix' ' | ||||||
| 	git mv c/b/a c/d/e && | 	git mv c/b/a c/d/e && | ||||||
| 	git commit -m "c/b/a -> c/d/e" && | 	git commit -m "c/b/a -> c/d/e" && | ||||||
| 	git diff -M --summary HEAD^ HEAD >output && | 	git diff -M --summary HEAD^ HEAD >output && | ||||||
| 	test_i18ngrep " c/{b/a => d/e} " output && | 	test_grep " c/{b/a => d/e} " output && | ||||||
| 	git diff -M --stat HEAD^ HEAD >output && | 	git diff -M --stat HEAD^ HEAD >output && | ||||||
| 	test_i18ngrep " c/{b/a => d/e} " output | 	test_grep " c/{b/a => d/e} " output | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'rename pretty print with common suffix' ' | test_expect_success 'rename pretty print with common suffix' ' | ||||||
|  | @ -222,9 +222,9 @@ test_expect_success 'rename pretty print with common suffix' ' | ||||||
| 	git mv c/d/e d/e && | 	git mv c/d/e d/e && | ||||||
| 	git commit -m "c/d/e -> d/e" && | 	git commit -m "c/d/e -> d/e" && | ||||||
| 	git diff -M --summary HEAD^ HEAD >output && | 	git diff -M --summary HEAD^ HEAD >output && | ||||||
| 	test_i18ngrep " {c/d => d}/e " output && | 	test_grep " {c/d => d}/e " output && | ||||||
| 	git diff -M --stat HEAD^ HEAD >output && | 	git diff -M --stat HEAD^ HEAD >output && | ||||||
| 	test_i18ngrep " {c/d => d}/e " output | 	test_grep " {c/d => d}/e " output | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'rename pretty print with common prefix and suffix' ' | test_expect_success 'rename pretty print with common prefix and suffix' ' | ||||||
|  | @ -232,9 +232,9 @@ test_expect_success 'rename pretty print with common prefix and suffix' ' | ||||||
| 	git mv d/e d/f/e && | 	git mv d/e d/f/e && | ||||||
| 	git commit -m "d/e -> d/f/e" && | 	git commit -m "d/e -> d/f/e" && | ||||||
| 	git diff -M --summary HEAD^ HEAD >output && | 	git diff -M --summary HEAD^ HEAD >output && | ||||||
| 	test_i18ngrep " d/{ => f}/e " output && | 	test_grep " d/{ => f}/e " output && | ||||||
| 	git diff -M --stat HEAD^ HEAD >output && | 	git diff -M --stat HEAD^ HEAD >output && | ||||||
| 	test_i18ngrep " d/{ => f}/e " output | 	test_grep " d/{ => f}/e " output | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'rename pretty print common prefix and suffix overlap' ' | test_expect_success 'rename pretty print common prefix and suffix overlap' ' | ||||||
|  | @ -242,9 +242,9 @@ test_expect_success 'rename pretty print common prefix and suffix overlap' ' | ||||||
| 	git mv d/f/e d/f/f/e && | 	git mv d/f/e d/f/f/e && | ||||||
| 	git commit -m "d/f/e d/f/f/e" && | 	git commit -m "d/f/e d/f/f/e" && | ||||||
| 	git diff -M --summary HEAD^ HEAD >output && | 	git diff -M --summary HEAD^ HEAD >output && | ||||||
| 	test_i18ngrep " d/f/{ => f}/e " output && | 	test_grep " d/f/{ => f}/e " output && | ||||||
| 	git diff -M --stat HEAD^ HEAD >output && | 	git diff -M --stat HEAD^ HEAD >output && | ||||||
| 	test_i18ngrep " d/f/{ => f}/e " output | 	test_grep " d/f/{ => f}/e " output | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'diff-tree -l0 defaults to a big rename limit, not zero' ' | test_expect_success 'diff-tree -l0 defaults to a big rename limit, not zero' ' | ||||||
|  |  | ||||||
|  | @ -621,7 +621,7 @@ test_expect_success 'diff -I<regex> --stat' ' | ||||||
|  |  | ||||||
| test_expect_success 'diff -I<regex>: detect malformed regex' ' | test_expect_success 'diff -I<regex>: detect malformed regex' ' | ||||||
| 	test_expect_code 129 git diff --ignore-matching-lines="^[124-9" 2>error && | 	test_expect_code 129 git diff --ignore-matching-lines="^[124-9" 2>error && | ||||||
| 	test_i18ngrep "invalid regex given to -I: " error | 	test_grep "invalid regex given to -I: " error | ||||||
| ' | ' | ||||||
|  |  | ||||||
| # check_prefix <patch> <src> <dst> | # check_prefix <patch> <src> <dst> | ||||||
|  |  | ||||||
|  | @ -2403,25 +2403,25 @@ test_expect_success 'interdiff: cover-letter' ' | ||||||
| 	--q | 	--q | ||||||
| 	EOF | 	EOF | ||||||
| 	git format-patch --cover-letter --interdiff=boop~2 -1 boop && | 	git format-patch --cover-letter --interdiff=boop~2 -1 boop && | ||||||
| 	test_i18ngrep "^Interdiff:$" 0000-cover-letter.patch && | 	test_grep "^Interdiff:$" 0000-cover-letter.patch && | ||||||
| 	test_i18ngrep ! "^Interdiff:$" 0001-fleep.patch && | 	test_grep ! "^Interdiff:$" 0001-fleep.patch && | ||||||
| 	sed "1,/^@@ /d; /^-- $/q" 0000-cover-letter.patch >actual && | 	sed "1,/^@@ /d; /^-- $/q" 0000-cover-letter.patch >actual && | ||||||
| 	test_cmp expect actual | 	test_cmp expect actual | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'interdiff: reroll-count' ' | test_expect_success 'interdiff: reroll-count' ' | ||||||
| 	git format-patch --cover-letter --interdiff=boop~2 -v2 -1 boop && | 	git format-patch --cover-letter --interdiff=boop~2 -v2 -1 boop && | ||||||
| 	test_i18ngrep "^Interdiff ..* v1:$" v2-0000-cover-letter.patch | 	test_grep "^Interdiff ..* v1:$" v2-0000-cover-letter.patch | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'interdiff: reroll-count with a non-integer' ' | test_expect_success 'interdiff: reroll-count with a non-integer' ' | ||||||
| 	git format-patch --cover-letter --interdiff=boop~2 -v2.2 -1 boop && | 	git format-patch --cover-letter --interdiff=boop~2 -v2.2 -1 boop && | ||||||
| 	test_i18ngrep "^Interdiff:$" v2.2-0000-cover-letter.patch | 	test_grep "^Interdiff:$" v2.2-0000-cover-letter.patch | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'interdiff: reroll-count with a integer' ' | test_expect_success 'interdiff: reroll-count with a integer' ' | ||||||
| 	git format-patch --cover-letter --interdiff=boop~2 -v2 -1 boop && | 	git format-patch --cover-letter --interdiff=boop~2 -v2 -1 boop && | ||||||
| 	test_i18ngrep "^Interdiff ..* v1:$" v2-0000-cover-letter.patch | 	test_grep "^Interdiff ..* v1:$" v2-0000-cover-letter.patch | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'interdiff: solo-patch' ' | test_expect_success 'interdiff: solo-patch' ' | ||||||
|  | @ -2430,7 +2430,7 @@ test_expect_success 'interdiff: solo-patch' ' | ||||||
|  |  | ||||||
| 	EOF | 	EOF | ||||||
| 	git format-patch --interdiff=boop~2 -1 boop && | 	git format-patch --interdiff=boop~2 -1 boop && | ||||||
| 	test_i18ngrep "^Interdiff:$" 0001-fleep.patch && | 	test_grep "^Interdiff:$" 0001-fleep.patch && | ||||||
| 	sed "1,/^  @@ /d; /^$/q" 0001-fleep.patch >actual && | 	sed "1,/^  @@ /d; /^$/q" 0001-fleep.patch >actual && | ||||||
| 	test_cmp expect actual | 	test_cmp expect actual | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  | @ -946,7 +946,7 @@ test_expect_success 'combined diff with autocrlf conversion' ' | ||||||
| 	git commit -m "the other side" x && | 	git commit -m "the other side" x && | ||||||
| 	git config core.autocrlf true && | 	git config core.autocrlf true && | ||||||
| 	test_must_fail git merge one-side >actual && | 	test_must_fail git merge one-side >actual && | ||||||
| 	test_i18ngrep "Automatic merge failed" actual && | 	test_grep "Automatic merge failed" actual && | ||||||
|  |  | ||||||
| 	git diff >actual.raw && | 	git diff >actual.raw && | ||||||
| 	sed -e "1,/^@@@/d" actual.raw >actual && | 	sed -e "1,/^@@@/d" actual.raw >actual && | ||||||
|  | @ -2224,27 +2224,27 @@ test_expect_success 'compare whitespace delta across moved blocks' ' | ||||||
|  |  | ||||||
| test_expect_success 'bogus settings in move detection erroring out' ' | test_expect_success 'bogus settings in move detection erroring out' ' | ||||||
| 	test_must_fail git diff --color-moved=bogus 2>err && | 	test_must_fail git diff --color-moved=bogus 2>err && | ||||||
| 	test_i18ngrep "must be one of" err && | 	test_grep "must be one of" err && | ||||||
| 	test_i18ngrep bogus err && | 	test_grep bogus err && | ||||||
|  |  | ||||||
| 	test_must_fail git -c diff.colormoved=bogus diff 2>err && | 	test_must_fail git -c diff.colormoved=bogus diff 2>err && | ||||||
| 	test_i18ngrep "must be one of" err && | 	test_grep "must be one of" err && | ||||||
| 	test_i18ngrep "from command-line config" err && | 	test_grep "from command-line config" err && | ||||||
|  |  | ||||||
| 	test_must_fail git diff --color-moved-ws=bogus 2>err && | 	test_must_fail git diff --color-moved-ws=bogus 2>err && | ||||||
| 	test_i18ngrep "possible values" err && | 	test_grep "possible values" err && | ||||||
| 	test_i18ngrep bogus err && | 	test_grep bogus err && | ||||||
|  |  | ||||||
| 	test_must_fail git -c diff.colormovedws=bogus diff 2>err && | 	test_must_fail git -c diff.colormovedws=bogus diff 2>err && | ||||||
| 	test_i18ngrep "possible values" err && | 	test_grep "possible values" err && | ||||||
| 	test_i18ngrep "from command-line config" err | 	test_grep "from command-line config" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'compare whitespace delta incompatible with other space options' ' | test_expect_success 'compare whitespace delta incompatible with other space options' ' | ||||||
| 	test_must_fail git diff \ | 	test_must_fail git diff \ | ||||||
| 		--color-moved-ws=allow-indentation-change,ignore-all-space \ | 		--color-moved-ws=allow-indentation-change,ignore-all-space \ | ||||||
| 		2>err && | 		2>err && | ||||||
| 	test_i18ngrep allow-indentation-change err | 	test_grep allow-indentation-change err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| EMPTY='' | EMPTY='' | ||||||
|  |  | ||||||
|  | @ -53,15 +53,15 @@ do | ||||||
| 		echo "*.java diff=$p" >.gitattributes && | 		echo "*.java diff=$p" >.gitattributes && | ||||||
| 		test_expect_code 1 git diff --no-index \ | 		test_expect_code 1 git diff --no-index \ | ||||||
| 			A.java B.java 2>msg && | 			A.java B.java 2>msg && | ||||||
| 		test_i18ngrep ! fatal msg && | 		test_grep ! fatal msg && | ||||||
| 		test_i18ngrep ! error msg | 		test_grep ! error msg | ||||||
| 	' | 	' | ||||||
| 	test_expect_success "builtin $p wordRegex pattern compiles" ' | 	test_expect_success "builtin $p wordRegex pattern compiles" ' | ||||||
| 		echo "*.java diff=$p" >.gitattributes && | 		echo "*.java diff=$p" >.gitattributes && | ||||||
| 		test_expect_code 1 git diff --no-index --word-diff \ | 		test_expect_code 1 git diff --no-index --word-diff \ | ||||||
| 			A.java B.java 2>msg && | 			A.java B.java 2>msg && | ||||||
| 		test_i18ngrep ! fatal msg && | 		test_grep ! fatal msg && | ||||||
| 		test_i18ngrep ! error msg | 		test_grep ! error msg | ||||||
| 	' | 	' | ||||||
|  |  | ||||||
| 	test_expect_success "builtin $p pattern compiles on bare repo with --attr-source" ' | 	test_expect_success "builtin $p pattern compiles on bare repo with --attr-source" ' | ||||||
|  | @ -79,8 +79,8 @@ do | ||||||
| 		git -C bare.git symbolic-ref HEAD refs/heads/master && | 		git -C bare.git symbolic-ref HEAD refs/heads/master && | ||||||
| 		test_expect_code 1 git -C bare.git --attr-source=branchA \ | 		test_expect_code 1 git -C bare.git --attr-source=branchA \ | ||||||
| 			diff --exit-code HEAD:A.java HEAD:B.java 2>msg && | 			diff --exit-code HEAD:A.java HEAD:B.java 2>msg && | ||||||
| 		test_i18ngrep ! fatal msg && | 		test_grep ! fatal msg && | ||||||
| 		test_i18ngrep ! error msg | 		test_grep ! error msg | ||||||
| 	' | 	' | ||||||
| done | done | ||||||
|  |  | ||||||
|  | @ -88,7 +88,7 @@ test_expect_success 'last regexp must not be negated' ' | ||||||
| 	echo "*.java diff=java" >.gitattributes && | 	echo "*.java diff=java" >.gitattributes && | ||||||
| 	test_config diff.java.funcname "!static" && | 	test_config diff.java.funcname "!static" && | ||||||
| 	test_expect_code 128 git diff --no-index A.java B.java 2>msg && | 	test_expect_code 128 git diff --no-index A.java B.java 2>msg && | ||||||
| 	test_i18ngrep ": Last expression must not be negated:" msg | 	test_grep ": Last expression must not be negated:" msg | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'setup hunk header tests' ' | test_expect_success 'setup hunk header tests' ' | ||||||
|  |  | ||||||
|  | @ -53,7 +53,7 @@ test_expect_success 'rewrite diff --numstat shows binary changes' ' | ||||||
| test_expect_success 'diff --stat counts binary rewrite as 0 lines' ' | test_expect_success 'diff --stat counts binary rewrite as 0 lines' ' | ||||||
| 	git diff -B --stat --summary >diff && | 	git diff -B --stat --summary >diff && | ||||||
| 	grep "Bin" diff && | 	grep "Bin" diff && | ||||||
| 	test_i18ngrep "0 insertions.*0 deletions" diff && | 	test_grep "0 insertions.*0 deletions" diff && | ||||||
| 	grep " rewrite file" diff | 	grep " rewrite file" diff | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  |  | ||||||
|  | @ -943,37 +943,37 @@ test_expect_success '--dirstat=future_param,lines,0 should fail loudly' ' | ||||||
| 	test_must_fail git diff --dirstat=future_param,lines,0 HEAD^..HEAD >actual_diff_dirstat 2>actual_error && | 	test_must_fail git diff --dirstat=future_param,lines,0 HEAD^..HEAD >actual_diff_dirstat 2>actual_error && | ||||||
| 	test_debug "cat actual_error" && | 	test_debug "cat actual_error" && | ||||||
| 	test_must_be_empty actual_diff_dirstat && | 	test_must_be_empty actual_diff_dirstat && | ||||||
| 	test_i18ngrep -q "future_param" actual_error && | 	test_grep -q "future_param" actual_error && | ||||||
| 	test_i18ngrep -q "\--dirstat" actual_error | 	test_grep -q "\--dirstat" actual_error | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success '--dirstat=dummy1,cumulative,2dummy should report both unrecognized parameters' ' | test_expect_success '--dirstat=dummy1,cumulative,2dummy should report both unrecognized parameters' ' | ||||||
| 	test_must_fail git diff --dirstat=dummy1,cumulative,2dummy HEAD^..HEAD >actual_diff_dirstat 2>actual_error && | 	test_must_fail git diff --dirstat=dummy1,cumulative,2dummy HEAD^..HEAD >actual_diff_dirstat 2>actual_error && | ||||||
| 	test_debug "cat actual_error" && | 	test_debug "cat actual_error" && | ||||||
| 	test_must_be_empty actual_diff_dirstat && | 	test_must_be_empty actual_diff_dirstat && | ||||||
| 	test_i18ngrep -q "dummy1" actual_error && | 	test_grep -q "dummy1" actual_error && | ||||||
| 	test_i18ngrep -q "2dummy" actual_error && | 	test_grep -q "2dummy" actual_error && | ||||||
| 	test_i18ngrep -q "\--dirstat" actual_error | 	test_grep -q "\--dirstat" actual_error | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'diff.dirstat=future_param,0,lines should warn, but still work' ' | test_expect_success 'diff.dirstat=future_param,0,lines should warn, but still work' ' | ||||||
| 	git -c diff.dirstat=future_param,0,lines diff --dirstat HEAD^..HEAD >actual_diff_dirstat 2>actual_error && | 	git -c diff.dirstat=future_param,0,lines diff --dirstat HEAD^..HEAD >actual_diff_dirstat 2>actual_error && | ||||||
| 	test_debug "cat actual_error" && | 	test_debug "cat actual_error" && | ||||||
| 	test_cmp expect_diff_dirstat actual_diff_dirstat && | 	test_cmp expect_diff_dirstat actual_diff_dirstat && | ||||||
| 	test_i18ngrep -q "future_param" actual_error && | 	test_grep -q "future_param" actual_error && | ||||||
| 	test_i18ngrep -q "diff\\.dirstat" actual_error && | 	test_grep -q "diff\\.dirstat" actual_error && | ||||||
|  |  | ||||||
| 	git -c diff.dirstat=future_param,0,lines diff --dirstat -M HEAD^..HEAD >actual_diff_dirstat_M 2>actual_error && | 	git -c diff.dirstat=future_param,0,lines diff --dirstat -M HEAD^..HEAD >actual_diff_dirstat_M 2>actual_error && | ||||||
| 	test_debug "cat actual_error" && | 	test_debug "cat actual_error" && | ||||||
| 	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M && | 	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M && | ||||||
| 	test_i18ngrep -q "future_param" actual_error && | 	test_grep -q "future_param" actual_error && | ||||||
| 	test_i18ngrep -q "diff\\.dirstat" actual_error && | 	test_grep -q "diff\\.dirstat" actual_error && | ||||||
|  |  | ||||||
| 	git -c diff.dirstat=future_param,0,lines diff --dirstat -C -C HEAD^..HEAD >actual_diff_dirstat_CC 2>actual_error && | 	git -c diff.dirstat=future_param,0,lines diff --dirstat -C -C HEAD^..HEAD >actual_diff_dirstat_CC 2>actual_error && | ||||||
| 	test_debug "cat actual_error" && | 	test_debug "cat actual_error" && | ||||||
| 	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC && | 	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC && | ||||||
| 	test_i18ngrep -q "future_param" actual_error && | 	test_grep -q "future_param" actual_error && | ||||||
| 	test_i18ngrep -q "diff\\.dirstat" actual_error | 	test_grep -q "diff\\.dirstat" actual_error | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success '--shortstat --dirstat should output only one dirstat' ' | test_expect_success '--shortstat --dirstat should output only one dirstat' ' | ||||||
|  |  | ||||||
|  | @ -56,7 +56,7 @@ test_expect_success 'git diff --no-index executed outside repo gives correct err | ||||||
| 		export GIT_CEILING_DIRECTORIES && | 		export GIT_CEILING_DIRECTORIES && | ||||||
| 		cd non/git && | 		cd non/git && | ||||||
| 		test_must_fail git diff --no-index a 2>actual.err && | 		test_must_fail git diff --no-index a 2>actual.err && | ||||||
| 		test_i18ngrep "usage: git diff --no-index" actual.err | 		test_grep "usage: git diff --no-index" actual.err | ||||||
| 	) | 	) | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  |  | ||||||
|  | @ -74,13 +74,13 @@ test_expect_success 'plumbing not affected' ' | ||||||
| test_expect_success 'non-integer config parsing' ' | test_expect_success 'non-integer config parsing' ' | ||||||
| 	git config diff.context no && | 	git config diff.context no && | ||||||
| 	test_must_fail git diff 2>output && | 	test_must_fail git diff 2>output && | ||||||
| 	test_i18ngrep "bad numeric config value" output | 	test_grep "bad numeric config value" output | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'negative integer config parsing' ' | test_expect_success 'negative integer config parsing' ' | ||||||
| 	git config diff.context -1 && | 	git config diff.context -1 && | ||||||
| 	test_must_fail git diff 2>output && | 	test_must_fail git diff 2>output && | ||||||
| 	test_i18ngrep "bad config variable" output | 	test_grep "bad config variable" output | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success '-U0 is valid, so is diff.context=0' ' | test_expect_success '-U0 is valid, so is diff.context=0' ' | ||||||
|  |  | ||||||
|  | @ -68,27 +68,27 @@ test_expect_success 'diff with two merge bases' ' | ||||||
|  |  | ||||||
| test_expect_success 'diff with no merge bases' ' | test_expect_success 'diff with no merge bases' ' | ||||||
| 	test_must_fail git diff br2...br3 2>err && | 	test_must_fail git diff br2...br3 2>err && | ||||||
| 	test_i18ngrep "fatal: br2...br3: no merge base" err | 	test_grep "fatal: br2...br3: no merge base" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'diff with too many symmetric differences' ' | test_expect_success 'diff with too many symmetric differences' ' | ||||||
| 	test_must_fail git diff br1...main br2...br3 2>err && | 	test_must_fail git diff br1...main br2...br3 2>err && | ||||||
| 	test_i18ngrep "usage" err | 	test_grep "usage" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'diff with symmetric difference and extraneous arg' ' | test_expect_success 'diff with symmetric difference and extraneous arg' ' | ||||||
| 	test_must_fail git diff main br1...main 2>err && | 	test_must_fail git diff main br1...main 2>err && | ||||||
| 	test_i18ngrep "usage" err | 	test_grep "usage" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'diff with two ranges' ' | test_expect_success 'diff with two ranges' ' | ||||||
| 	test_must_fail git diff main br1..main br2..br3 2>err && | 	test_must_fail git diff main br1..main br2..br3 2>err && | ||||||
| 	test_i18ngrep "usage" err | 	test_grep "usage" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'diff with ranges and extra arg' ' | test_expect_success 'diff with ranges and extra arg' ' | ||||||
| 	test_must_fail git diff main br1..main commit-D 2>err && | 	test_must_fail git diff main br1..main commit-D 2>err && | ||||||
| 	test_i18ngrep "usage" err | 	test_grep "usage" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'diff --merge-base with no commits' ' | test_expect_success 'diff --merge-base with no commits' ' | ||||||
|  | @ -97,7 +97,7 @@ test_expect_success 'diff --merge-base with no commits' ' | ||||||
|  |  | ||||||
| test_expect_success 'diff --merge-base with three commits' ' | test_expect_success 'diff --merge-base with three commits' ' | ||||||
| 	test_must_fail git diff --merge-base br1 br2 main 2>err && | 	test_must_fail git diff --merge-base br1 br2 main 2>err && | ||||||
| 	test_i18ngrep "usage" err | 	test_grep "usage" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| for cmd in diff-index diff | for cmd in diff-index diff | ||||||
|  | @ -150,19 +150,19 @@ do | ||||||
| 	test_expect_success "$cmd --merge-base with non-commit" ' | 	test_expect_success "$cmd --merge-base with non-commit" ' | ||||||
| 		git checkout main && | 		git checkout main && | ||||||
| 		test_must_fail git $cmd --merge-base main^{tree} 2>err && | 		test_must_fail git $cmd --merge-base main^{tree} 2>err && | ||||||
| 		test_i18ngrep "is a tree, not a commit" err | 		test_grep "is a tree, not a commit" err | ||||||
| 	' | 	' | ||||||
|  |  | ||||||
| 	test_expect_success "$cmd --merge-base with no merge bases and one commit" ' | 	test_expect_success "$cmd --merge-base with no merge bases and one commit" ' | ||||||
| 		git checkout main && | 		git checkout main && | ||||||
| 		test_must_fail git $cmd --merge-base br3 2>err && | 		test_must_fail git $cmd --merge-base br3 2>err && | ||||||
| 		test_i18ngrep "fatal: no merge base found" err | 		test_grep "fatal: no merge base found" err | ||||||
| 	' | 	' | ||||||
|  |  | ||||||
| 	test_expect_success "$cmd --merge-base with multiple merge bases and one commit" ' | 	test_expect_success "$cmd --merge-base with multiple merge bases and one commit" ' | ||||||
| 		git checkout main && | 		git checkout main && | ||||||
| 		test_must_fail git $cmd --merge-base br1 2>err && | 		test_must_fail git $cmd --merge-base br1 2>err && | ||||||
| 		test_i18ngrep "fatal: multiple merge bases found" err | 		test_grep "fatal: multiple merge bases found" err | ||||||
| 	' | 	' | ||||||
| done | done | ||||||
|  |  | ||||||
|  | @ -176,28 +176,28 @@ do | ||||||
|  |  | ||||||
| 	test_expect_success "$cmd --merge-base commit and non-commit" ' | 	test_expect_success "$cmd --merge-base commit and non-commit" ' | ||||||
| 		test_must_fail git $cmd --merge-base br2 main^{tree} 2>err && | 		test_must_fail git $cmd --merge-base br2 main^{tree} 2>err && | ||||||
| 		test_i18ngrep "is a tree, not a commit" err | 		test_grep "is a tree, not a commit" err | ||||||
| 	' | 	' | ||||||
|  |  | ||||||
| 	test_expect_success "$cmd --merge-base with no merge bases and two commits" ' | 	test_expect_success "$cmd --merge-base with no merge bases and two commits" ' | ||||||
| 		test_must_fail git $cmd --merge-base br2 br3 2>err && | 		test_must_fail git $cmd --merge-base br2 br3 2>err && | ||||||
| 		test_i18ngrep "fatal: no merge base found" err | 		test_grep "fatal: no merge base found" err | ||||||
| 	' | 	' | ||||||
|  |  | ||||||
| 	test_expect_success "$cmd --merge-base with multiple merge bases and two commits" ' | 	test_expect_success "$cmd --merge-base with multiple merge bases and two commits" ' | ||||||
| 		test_must_fail git $cmd --merge-base main br1 2>err && | 		test_must_fail git $cmd --merge-base main br1 2>err && | ||||||
| 		test_i18ngrep "fatal: multiple merge bases found" err | 		test_grep "fatal: multiple merge bases found" err | ||||||
| 	' | 	' | ||||||
| done | done | ||||||
|  |  | ||||||
| test_expect_success 'diff-tree --merge-base with one commit' ' | test_expect_success 'diff-tree --merge-base with one commit' ' | ||||||
| 	test_must_fail git diff-tree --merge-base main 2>err && | 	test_must_fail git diff-tree --merge-base main 2>err && | ||||||
| 	test_i18ngrep "fatal: --merge-base only works with two commits" err | 	test_grep "fatal: --merge-base only works with two commits" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'diff --merge-base with range' ' | test_expect_success 'diff --merge-base with range' ' | ||||||
| 	test_must_fail git diff --merge-base br2..br3 2>err && | 	test_must_fail git diff --merge-base br2..br3 2>err && | ||||||
| 	test_i18ngrep "fatal: --merge-base does not work with ranges" err | 	test_grep "fatal: --merge-base does not work with ranges" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_done | test_done | ||||||
|  |  | ||||||
|  | @ -136,7 +136,7 @@ test_expect_success SYMLINKS '--reject removes .rej symlink if it exists' ' | ||||||
|  |  | ||||||
| 	ln -s foo file.t.rej && | 	ln -s foo file.t.rej && | ||||||
| 	test_must_fail git apply patch --reject 2>err && | 	test_must_fail git apply patch --reject 2>err && | ||||||
| 	test_i18ngrep "Rejected hunk" err && | 	test_grep "Rejected hunk" err && | ||||||
| 	test_path_is_missing foo && | 	test_path_is_missing foo && | ||||||
| 	test_path_is_file file.t.rej | 	test_path_is_file file.t.rej | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  | @ -31,7 +31,7 @@ test_expect_success 'apply git diff with -p2' ' | ||||||
| test_expect_success 'apply with too large -p' ' | test_expect_success 'apply with too large -p' ' | ||||||
| 	cp file1.saved file1 && | 	cp file1.saved file1 && | ||||||
| 	test_must_fail git apply --stat -p3 patch.file 2>err && | 	test_must_fail git apply --stat -p3 patch.file 2>err && | ||||||
| 	test_i18ngrep "removing 3 leading" err | 	test_grep "removing 3 leading" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'apply (-p2) traditional diff with funny filenames' ' | test_expect_success 'apply (-p2) traditional diff with funny filenames' ' | ||||||
|  | @ -53,7 +53,7 @@ test_expect_success 'apply (-p2) traditional diff with funny filenames' ' | ||||||
| test_expect_success 'apply with too large -p and fancy filename' ' | test_expect_success 'apply with too large -p and fancy filename' ' | ||||||
| 	cp file1.saved file1 && | 	cp file1.saved file1 && | ||||||
| 	test_must_fail git apply --stat -p3 patch.escaped 2>err && | 	test_must_fail git apply --stat -p3 patch.escaped 2>err && | ||||||
| 	test_i18ngrep "removing 3 leading" err | 	test_grep "removing 3 leading" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'apply (-p2) diff, mode change only' ' | test_expect_success 'apply (-p2) diff, mode change only' ' | ||||||
|  |  | ||||||
|  | @ -95,19 +95,19 @@ test_expect_success SYMLINKS 'do not follow symbolic link (same input)' ' | ||||||
|  |  | ||||||
| 	# same input creates a confusing symbolic link | 	# same input creates a confusing symbolic link | ||||||
| 	test_must_fail git apply patch 2>error-wt && | 	test_must_fail git apply patch 2>error-wt && | ||||||
| 	test_i18ngrep "beyond a symbolic link" error-wt && | 	test_grep "beyond a symbolic link" error-wt && | ||||||
| 	test_path_is_missing arch/x86_64/dir && | 	test_path_is_missing arch/x86_64/dir && | ||||||
| 	test_path_is_missing arch/i386/dir/file && | 	test_path_is_missing arch/i386/dir/file && | ||||||
|  |  | ||||||
| 	test_must_fail git apply --index patch 2>error-ix && | 	test_must_fail git apply --index patch 2>error-ix && | ||||||
| 	test_i18ngrep "beyond a symbolic link" error-ix && | 	test_grep "beyond a symbolic link" error-ix && | ||||||
| 	test_path_is_missing arch/x86_64/dir && | 	test_path_is_missing arch/x86_64/dir && | ||||||
| 	test_path_is_missing arch/i386/dir/file && | 	test_path_is_missing arch/i386/dir/file && | ||||||
| 	test_must_fail git ls-files --error-unmatch arch/x86_64/dir && | 	test_must_fail git ls-files --error-unmatch arch/x86_64/dir && | ||||||
| 	test_must_fail git ls-files --error-unmatch arch/i386/dir && | 	test_must_fail git ls-files --error-unmatch arch/i386/dir && | ||||||
|  |  | ||||||
| 	test_must_fail git apply --cached patch 2>error-ct && | 	test_must_fail git apply --cached patch 2>error-ct && | ||||||
| 	test_i18ngrep "beyond a symbolic link" error-ct && | 	test_grep "beyond a symbolic link" error-ct && | ||||||
| 	test_must_fail git ls-files --error-unmatch arch/x86_64/dir && | 	test_must_fail git ls-files --error-unmatch arch/x86_64/dir && | ||||||
| 	test_must_fail git ls-files --error-unmatch arch/i386/dir && | 	test_must_fail git ls-files --error-unmatch arch/i386/dir && | ||||||
|  |  | ||||||
|  | @ -135,23 +135,23 @@ test_expect_success SYMLINKS 'do not follow symbolic link (existing)' ' | ||||||
| 	git add arch/x86_64/dir && | 	git add arch/x86_64/dir && | ||||||
|  |  | ||||||
| 	test_must_fail git apply add_file.patch 2>error-wt-add && | 	test_must_fail git apply add_file.patch 2>error-wt-add && | ||||||
| 	test_i18ngrep "beyond a symbolic link" error-wt-add && | 	test_grep "beyond a symbolic link" error-wt-add && | ||||||
| 	test_path_is_missing arch/i386/dir/file && | 	test_path_is_missing arch/i386/dir/file && | ||||||
|  |  | ||||||
| 	mkdir arch/i386/dir && | 	mkdir arch/i386/dir && | ||||||
| 	>arch/i386/dir/file && | 	>arch/i386/dir/file && | ||||||
| 	test_must_fail git apply del_file.patch 2>error-wt-del && | 	test_must_fail git apply del_file.patch 2>error-wt-del && | ||||||
| 	test_i18ngrep "beyond a symbolic link" error-wt-del && | 	test_grep "beyond a symbolic link" error-wt-del && | ||||||
| 	test_path_is_file arch/i386/dir/file && | 	test_path_is_file arch/i386/dir/file && | ||||||
| 	rm arch/i386/dir/file && | 	rm arch/i386/dir/file && | ||||||
|  |  | ||||||
| 	test_must_fail git apply --index add_file.patch 2>error-ix-add && | 	test_must_fail git apply --index add_file.patch 2>error-ix-add && | ||||||
| 	test_i18ngrep "beyond a symbolic link" error-ix-add && | 	test_grep "beyond a symbolic link" error-ix-add && | ||||||
| 	test_path_is_missing arch/i386/dir/file && | 	test_path_is_missing arch/i386/dir/file && | ||||||
| 	test_must_fail git ls-files --error-unmatch arch/i386/dir && | 	test_must_fail git ls-files --error-unmatch arch/i386/dir && | ||||||
|  |  | ||||||
| 	test_must_fail git apply --cached add_file.patch 2>error-ct-file && | 	test_must_fail git apply --cached add_file.patch 2>error-ct-file && | ||||||
| 	test_i18ngrep "beyond a symbolic link" error-ct-file && | 	test_grep "beyond a symbolic link" error-ct-file && | ||||||
| 	test_must_fail git ls-files --error-unmatch arch/i386/dir | 	test_must_fail git ls-files --error-unmatch arch/i386/dir | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  |  | ||||||
|  | @ -66,13 +66,13 @@ test_expect_success FILEMODE 'mode update (index only)' ' | ||||||
| test_expect_success FILEMODE 'empty mode is rejected' ' | test_expect_success FILEMODE 'empty mode is rejected' ' | ||||||
| 	git reset --hard && | 	git reset --hard && | ||||||
| 	test_must_fail git apply patch-empty-mode.txt 2>err && | 	test_must_fail git apply patch-empty-mode.txt 2>err && | ||||||
| 	test_i18ngrep "invalid mode" err | 	test_grep "invalid mode" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success FILEMODE 'bogus mode is rejected' ' | test_expect_success FILEMODE 'bogus mode is rejected' ' | ||||||
| 	git reset --hard && | 	git reset --hard && | ||||||
| 	test_must_fail git apply patch-bogus-mode.txt 2>err && | 	test_must_fail git apply patch-bogus-mode.txt 2>err && | ||||||
| 	test_i18ngrep "invalid mode" err | 	test_grep "invalid mode" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success POSIXPERM 'do not use core.sharedRepository for working tree files' ' | test_expect_success POSIXPERM 'do not use core.sharedRepository for working tree files' ' | ||||||
|  |  | ||||||
|  | @ -32,9 +32,9 @@ EOF | ||||||
|  |  | ||||||
| test_expect_success 'apply diff with inconsistent filenames in headers' ' | test_expect_success 'apply diff with inconsistent filenames in headers' ' | ||||||
| 	test_must_fail git apply bad1.patch 2>err && | 	test_must_fail git apply bad1.patch 2>err && | ||||||
| 	test_i18ngrep "inconsistent new filename" err && | 	test_grep "inconsistent new filename" err && | ||||||
| 	test_must_fail git apply bad2.patch 2>err && | 	test_must_fail git apply bad2.patch 2>err && | ||||||
| 	test_i18ngrep "inconsistent old filename" err | 	test_grep "inconsistent old filename" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'apply diff with new filename missing from headers' ' | test_expect_success 'apply diff with new filename missing from headers' ' | ||||||
|  | @ -46,7 +46,7 @@ test_expect_success 'apply diff with new filename missing from headers' ' | ||||||
| 	+1 | 	+1 | ||||||
| 	EOF | 	EOF | ||||||
| 	test_must_fail git apply missing_new_filename.diff 2>err && | 	test_must_fail git apply missing_new_filename.diff 2>err && | ||||||
| 	test_i18ngrep "lacks filename information" err | 	test_grep "lacks filename information" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'apply diff with old filename missing from headers' ' | test_expect_success 'apply diff with old filename missing from headers' ' | ||||||
|  | @ -58,7 +58,7 @@ test_expect_success 'apply diff with old filename missing from headers' ' | ||||||
| 	-1 | 	-1 | ||||||
| 	EOF | 	EOF | ||||||
| 	test_must_fail git apply missing_old_filename.diff 2>err && | 	test_must_fail git apply missing_old_filename.diff 2>err && | ||||||
| 	test_i18ngrep "lacks filename information" err | 	test_grep "lacks filename information" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_done | test_done | ||||||
|  |  | ||||||
|  | @ -779,7 +779,7 @@ test_expect_success 'am --resolved fails if index has unmerged entries' ' | ||||||
| 	test_must_fail git am --resolved >err && | 	test_must_fail git am --resolved >err && | ||||||
| 	test_path_is_dir .git/rebase-apply && | 	test_path_is_dir .git/rebase-apply && | ||||||
| 	test_cmp_rev second HEAD && | 	test_cmp_rev second HEAD && | ||||||
| 	test_i18ngrep "still have unmerged paths" err | 	test_grep "still have unmerged paths" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'am takes patches from a Pine mailbox' ' | test_expect_success 'am takes patches from a Pine mailbox' ' | ||||||
|  | @ -913,7 +913,7 @@ test_expect_success 'am newline in subject' ' | ||||||
| 	test_tick && | 	test_tick && | ||||||
| 	sed -e "s/second/second \\\n foo/" patch1 >patchnl && | 	sed -e "s/second/second \\\n foo/" patch1 >patchnl && | ||||||
| 	git am <patchnl >output.out 2>&1 && | 	git am <patchnl >output.out 2>&1 && | ||||||
| 	test_i18ngrep "^Applying: second \\\n foo$" output.out | 	test_grep "^Applying: second \\\n foo$" output.out | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'am -q is quiet' ' | test_expect_success 'am -q is quiet' ' | ||||||
|  |  | ||||||
Some files were not shown because too many files have changed in this diff Show More
		Loading…
	
		Reference in New Issue
	
	 Junio C Hamano
						Junio C Hamano