summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rwxr-xr-xt/t0201-gettext-fallbacks.sh8
-rwxr-xr-xt/t1100-commit-tree-options.sh1
-rwxr-xr-xt/t3400-rebase.sh8
-rwxr-xr-xt/t3404-rebase-interactive.sh2
-rwxr-xr-xt/t3406-rebase-message.sh9
-rwxr-xr-xt/t6022-merge-rename.sh16
-rwxr-xr-xt/t6042-merge-rename-corner-cases.sh2
-rwxr-xr-x[-rw-r--r--]t/t7409-submodule-detached-worktree.sh29
-rwxr-xr-xt/t7810-grep.sh11
9 files changed, 50 insertions, 36 deletions
diff --git a/t/t0201-gettext-fallbacks.sh b/t/t0201-gettext-fallbacks.sh
index 52b1c27..5d80a98 100755
--- a/t/t0201-gettext-fallbacks.sh
+++ b/t/t0201-gettext-fallbacks.sh
@@ -51,16 +51,16 @@ test_expect_success 'eval_gettext: our eval_gettext() fallback can interpolate v
test_expect_success 'eval_gettext: our eval_gettext() fallback can interpolate variables with spaces' '
cmdline="git am" &&
export cmdline;
- printf "When you have resolved this problem run git am --resolved." >expect &&
- eval_gettext "When you have resolved this problem run \$cmdline --resolved." >actual
+ printf "When you have resolved this problem, run git am --resolved." >expect &&
+ eval_gettext "When you have resolved this problem, run \$cmdline --resolved." >actual
test_i18ncmp expect actual
'
test_expect_success 'eval_gettext: our eval_gettext() fallback can interpolate variables with spaces and quotes' '
cmdline="git am" &&
export cmdline;
- printf "When you have resolved this problem run \"git am --resolved\"." >expect &&
- eval_gettext "When you have resolved this problem run \"\$cmdline --resolved\"." >actual
+ printf "When you have resolved this problem, run \"git am --resolved\"." >expect &&
+ eval_gettext "When you have resolved this problem, run \"\$cmdline --resolved\"." >actual
test_i18ncmp expect actual
'
diff --git a/t/t1100-commit-tree-options.sh b/t/t1100-commit-tree-options.sh
index a3b7723..f8457f9 100755
--- a/t/t1100-commit-tree-options.sh
+++ b/t/t1100-commit-tree-options.sh
@@ -47,6 +47,7 @@ test_expect_success \
test_expect_success 'flags and then non flags' '
+ test_tick &&
echo comment text |
git commit-tree $(cat treeid) >commitid &&
echo comment text |
diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh
index 7788ae0..1de0ebd 100755
--- a/t/t3400-rebase.sh
+++ b/t/t3400-rebase.sh
@@ -68,24 +68,24 @@ test_expect_success 'rebase against master' '
test_expect_success 'rebase against master twice' '
git rebase master >out &&
- grep "Current branch my-topic-branch is up to date" out
+ test_i18ngrep "Current branch my-topic-branch is up to date" out
'
test_expect_success 'rebase against master twice with --force' '
git rebase --force-rebase master >out &&
- grep "Current branch my-topic-branch is up to date, rebase forced" out
+ test_i18ngrep "Current branch my-topic-branch is up to date, rebase forced" out
'
test_expect_success 'rebase against master twice from another branch' '
git checkout my-topic-branch^ &&
git rebase master my-topic-branch >out &&
- grep "Current branch my-topic-branch is up to date" out
+ test_i18ngrep "Current branch my-topic-branch is up to date" out
'
test_expect_success 'rebase fast-forward to master' '
git checkout my-topic-branch^ &&
git rebase my-topic-branch >out &&
- grep "Fast-forwarded HEAD to my-topic-branch" out
+ test_i18ngrep "Fast-forwarded HEAD to my-topic-branch" out
'
test_expect_success 'the rebase operation should not have destroyed author information' '
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 3f75d32..7304b66 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -858,7 +858,7 @@ test_expect_success 'rebase -ix with --autosquash' '
test_expect_success 'rebase --exec without -i shows error message' '
git reset --hard execute &&
test_must_fail git rebase --exec "git show HEAD" HEAD~2 2>actual &&
- echo "--exec option must be used with --interactive option" >expected &&
+ echo "The --exec option must be used with the --interactive option" >expected &&
test_i18ncmp expected actual
'
diff --git a/t/t3406-rebase-message.sh b/t/t3406-rebase-message.sh
index 6898377..e6a9a0d 100755
--- a/t/t3406-rebase-message.sh
+++ b/t/t3406-rebase-message.sh
@@ -62,9 +62,16 @@ test_expect_success 'rebase -n overrides config rebase.stat config' '
! grep "^ fileX | *1 +$" diffstat.txt
'
+# Output to stderr:
+#
+# "Does not point to a valid commit: invalid-ref"
+#
+# NEEDSWORK: This "grep" is fine in real non-C locales, but
+# GETTEXT_POISON poisons the refname along with the enclosing
+# error message.
test_expect_success 'rebase --onto outputs the invalid ref' '
test_must_fail git rebase --onto invalid-ref HEAD HEAD 2>err &&
- grep "invalid-ref" err
+ test_i18ngrep "invalid-ref" err
'
test_done
diff --git a/t/t6022-merge-rename.sh b/t/t6022-merge-rename.sh
index 1104249..c680f78 100755
--- a/t/t6022-merge-rename.sh
+++ b/t/t6022-merge-rename.sh
@@ -242,10 +242,10 @@ test_expect_success 'merge of identical changes in a renamed file' '
rm -f A M N &&
git reset --hard &&
git checkout change+rename &&
- GIT_MERGE_VERBOSITY=3 git merge change | grep "^Skipped B" &&
+ GIT_MERGE_VERBOSITY=3 git merge change | test_i18ngrep "^Skipped B" &&
git reset --hard HEAD^ &&
git checkout change &&
- GIT_MERGE_VERBOSITY=3 git merge change+rename | grep "^Skipped B"
+ GIT_MERGE_VERBOSITY=3 git merge change+rename | test_i18ngrep "^Skipped B"
'
test_expect_success 'setup for rename + d/f conflicts' '
@@ -303,9 +303,9 @@ test_expect_success 'Rename+D/F conflict; renamed file merges but dir in way' '
git checkout -q renamed-file-has-no-conflicts^0 &&
test_must_fail git merge --strategy=recursive dir-in-way >output &&
- grep "CONFLICT (modify/delete): dir/file-in-the-way" output &&
- grep "Auto-merging dir" output &&
- grep "Adding as dir~HEAD instead" output &&
+ test_i18ngrep "CONFLICT (modify/delete): dir/file-in-the-way" output &&
+ test_i18ngrep "Auto-merging dir" output &&
+ test_i18ngrep "Adding as dir~HEAD instead" output &&
test 3 -eq "$(git ls-files -u | wc -l)" &&
test 2 -eq "$(git ls-files -u dir/file-in-the-way | wc -l)" &&
@@ -325,9 +325,9 @@ test_expect_success 'Same as previous, but merged other way' '
test_must_fail git merge --strategy=recursive renamed-file-has-no-conflicts >output 2>errors &&
! grep "error: refusing to lose untracked file at" errors &&
- grep "CONFLICT (modify/delete): dir/file-in-the-way" output &&
- grep "Auto-merging dir" output &&
- grep "Adding as dir~renamed-file-has-no-conflicts instead" output &&
+ test_i18ngrep "CONFLICT (modify/delete): dir/file-in-the-way" output &&
+ test_i18ngrep "Auto-merging dir" output &&
+ test_i18ngrep "Adding as dir~renamed-file-has-no-conflicts instead" output &&
test 3 -eq "$(git ls-files -u | wc -l)" &&
test 2 -eq "$(git ls-files -u dir/file-in-the-way | wc -l)" &&
diff --git a/t/t6042-merge-rename-corner-cases.sh b/t/t6042-merge-rename-corner-cases.sh
index 466fa38..411550d 100755
--- a/t/t6042-merge-rename-corner-cases.sh
+++ b/t/t6042-merge-rename-corner-cases.sh
@@ -380,7 +380,7 @@ test_expect_success 'handle rename/rename (2to1) conflict correctly' '
git checkout B^0 &&
test_must_fail git merge -s recursive C^0 >out &&
- grep "CONFLICT (rename/rename)" out &&
+ test_i18ngrep "CONFLICT (rename/rename)" out &&
test 2 -eq $(git ls-files -s | wc -l) &&
test 2 -eq $(git ls-files -u | wc -l) &&
diff --git a/t/t7409-submodule-detached-worktree.sh b/t/t7409-submodule-detached-worktree.sh
index db75642..2fec13d 100644..100755
--- a/t/t7409-submodule-detached-worktree.sh
+++ b/t/t7409-submodule-detached-worktree.sh
@@ -15,7 +15,11 @@ TEST_NO_CREATE_REPO=1
test_expect_success 'submodule on detached working tree' '
git init --bare remote &&
test_create_repo bundle1 &&
- (cd bundle1 && test_commit "shoot") &&
+ (
+ cd bundle1 &&
+ test_commit "shoot" &&
+ git rev-parse --verify HEAD >../expect
+ ) &&
mkdir home &&
(
cd home &&
@@ -23,14 +27,27 @@ test_expect_success 'submodule on detached working tree' '
git clone --bare ../remote .dotfiles &&
git submodule add ../bundle1 .vim/bundle/sogood &&
test_commit "sogood" &&
+ (
+ unset GIT_WORK_TREE GIT_DIR &&
+ cd .vim/bundle/sogood &&
+ git rev-parse --verify HEAD >actual &&
+ test_cmp ../../../../expect actual
+ ) &&
git push origin master
) &&
mkdir home2 &&
(
cd home2 &&
- export GIT_WORK_TREE="$(pwd)" GIT_DIR="$(pwd)/.dotfiles" &&
git clone --bare ../remote .dotfiles &&
- git submodule update --init
+ export GIT_WORK_TREE="$(pwd)" GIT_DIR="$(pwd)/.dotfiles" &&
+ git checkout master &&
+ git submodule update --init &&
+ (
+ unset GIT_WORK_TREE GIT_DIR &&
+ cd .vim/bundle/sogood &&
+ git rev-parse --verify HEAD >actual &&
+ test_cmp ../../../../expect actual
+ )
)
'
@@ -42,6 +59,7 @@ test_expect_success 'submodule on detached working pointed by core.worktree' '
git clone --bare ../remote "$GIT_DIR" &&
git config core.bare false &&
git config core.worktree .. &&
+ git checkout master &&
git submodule add ../bundle1 .vim/bundle/dupe &&
test_commit "dupe" &&
git push origin master
@@ -52,9 +70,8 @@ test_expect_success 'submodule on detached working pointed by core.worktree' '
git config core.bare false &&
git config core.worktree .. &&
git pull &&
- git submodule update &&
- git submodule status &&
- test -d .vim/bundle/dupe
+ git submodule update --init &&
+ test -f .vim/bundle/dupe/shoot.t
)
'
diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh
index 24e9b19..523d041 100755
--- a/t/t7810-grep.sh
+++ b/t/t7810-grep.sh
@@ -399,17 +399,6 @@ test_expect_success 'grep -q, silently report matches' '
test_cmp empty actual
'
-# Create 1024 file names that sort between "y" and "z" to make sure
-# the two files are handled by different calls to an external grep.
-# This depends on MAXARGS in builtin-grep.c being 1024 or less.
-c32="0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v"
-test_expect_success 'grep -C1, hunk mark between files' '
- for a in $c32; do for b in $c32; do : >y-$a$b; done; done &&
- git add y-?? &&
- git grep -C1 "^[yz]" >actual &&
- test_cmp expected actual
-'
-
test_expect_success 'grep -C1 hunk mark between files' '
git grep -C1 "^[yz]" >actual &&
test_cmp expected actual