diff options
Diffstat (limited to 't')
-rwxr-xr-x | t/t0060-path-utils.sh | 13 | ||||
-rwxr-xr-x | t/t1091-sparse-checkout-builtin.sh | 39 | ||||
-rwxr-xr-x | t/t3008-ls-files-lazy-init-name-hash.sh | 2 | ||||
-rwxr-xr-x | t/t3422-rebase-incompatible-options.sh | 2 | ||||
-rwxr-xr-x | t/t3433-rebase-options-compatibility.sh | 131 | ||||
-rwxr-xr-x | t/t4215-log-skewed-merges.sh | 71 | ||||
-rwxr-xr-x | t/t7415-submodule-names.sh | 7 |
7 files changed, 128 insertions, 137 deletions
diff --git a/t/t0060-path-utils.sh b/t/t0060-path-utils.sh index de2df573a7..2ea2d00c39 100755 --- a/t/t0060-path-utils.sh +++ b/t/t0060-path-utils.sh @@ -469,11 +469,14 @@ test_expect_success 'match .gitmodules' ' ' test_expect_success MINGW 'is_valid_path() on Windows' ' - test-tool path-utils is_valid_path \ + test-tool path-utils is_valid_path \ win32 \ "win32 x" \ ../hello.txt \ C:\\git \ + comm \ + conout.c \ + lptN \ \ --not \ "win32 " \ @@ -481,7 +484,13 @@ test_expect_success MINGW 'is_valid_path() on Windows' ' "win32." \ "win32 . ." \ .../hello.txt \ - colon:test + colon:test \ + "AUX.c" \ + "abc/conOut\$ .xyz/test" \ + lpt8 \ + "lpt*" \ + Nul \ + "PRN./abc" ' test_done diff --git a/t/t1091-sparse-checkout-builtin.sh b/t/t1091-sparse-checkout-builtin.sh index 6f7e2d0c9e..ff7f8f7a1f 100755 --- a/t/t1091-sparse-checkout-builtin.sh +++ b/t/t1091-sparse-checkout-builtin.sh @@ -246,6 +246,17 @@ test_expect_success 'cone mode: init and set' ' test_cmp expect dir ' +test_expect_success 'cone mode: list' ' + cat >expect <<-EOF && + folder1 + folder2 + EOF + git -C repo sparse-checkout set --stdin <expect && + git -C repo sparse-checkout list >actual 2>err && + test_must_be_empty err && + test_cmp expect actual +' + test_expect_success 'cone mode: set with nested folders' ' git -C repo sparse-checkout set deep deep/deeper1/deepest 2>err && test_line_count = 0 err && @@ -329,4 +340,32 @@ test_expect_success 'cone mode: set with core.ignoreCase=true' ' test_cmp expect dir ' +test_expect_success 'interaction with submodules' ' + git clone repo super && + ( + cd super && + mkdir modules && + git submodule add ../repo modules/child && + git add . && + git commit -m "add submodule" && + git sparse-checkout init --cone && + git sparse-checkout set folder1 + ) && + list_files super >dir && + cat >expect <<-\EOF && + a + folder1 + modules + EOF + test_cmp expect dir && + list_files super/modules/child >dir && + cat >expect <<-\EOF && + a + deep + folder1 + folder2 + EOF + test_cmp expect dir +' + test_done diff --git a/t/t3008-ls-files-lazy-init-name-hash.sh b/t/t3008-ls-files-lazy-init-name-hash.sh index 64f047332b..85f3704958 100755 --- a/t/t3008-ls-files-lazy-init-name-hash.sh +++ b/t/t3008-ls-files-lazy-init-name-hash.sh @@ -4,7 +4,7 @@ test_description='Test the lazy init name hash with various folder structures' . ./test-lib.sh -if test 1 -eq $($GIT_BUILD_DIR/t/helper/test-tool online-cpus) +if test 1 -eq $(test-tool online-cpus) then skip_all='skipping lazy-init tests, single cpu' test_done diff --git a/t/t3422-rebase-incompatible-options.sh b/t/t3422-rebase-incompatible-options.sh index c8234062c6..50e7960702 100755 --- a/t/t3422-rebase-incompatible-options.sh +++ b/t/t3422-rebase-incompatible-options.sh @@ -61,6 +61,8 @@ test_rebase_am_only () { } test_rebase_am_only --whitespace=fix +test_rebase_am_only --ignore-whitespace +test_rebase_am_only --committer-date-is-author-date test_rebase_am_only -C4 test_expect_success REBASE_P '--preserve-merges incompatible with --signoff' ' diff --git a/t/t3433-rebase-options-compatibility.sh b/t/t3433-rebase-options-compatibility.sh deleted file mode 100755 index 5166f158dd..0000000000 --- a/t/t3433-rebase-options-compatibility.sh +++ /dev/null @@ -1,131 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2019 Rohit Ashiwal -# - -test_description='tests to ensure compatibility between am and interactive backends' - -. ./test-lib.sh - -GIT_AUTHOR_DATE="1999-04-02T08:03:20+05:30" -export GIT_AUTHOR_DATE - -# This is a special case in which both am and interactive backends -# provide the same output. It was done intentionally because -# both the backends fall short of optimal behaviour. -test_expect_success 'setup' ' - git checkout -b topic && - q_to_tab >file <<-\EOF && - line 1 - Qline 2 - line 3 - EOF - git add file && - git commit -m "add file" && - cat >file <<-\EOF && - line 1 - new line 2 - line 3 - EOF - git commit -am "update file" && - git tag side && - test_commit commit1 foo foo1 && - test_commit commit2 foo foo2 && - test_commit commit3 foo foo3 && - - git checkout --orphan master && - git rm --cached foo && - rm foo && - sed -e "s/^|//" >file <<-\EOF && - |line 1 - | line 2 - |line 3 - EOF - git add file && - git commit -m "add file" && - git tag main -' - -test_expect_success '--ignore-whitespace works with am backend' ' - cat >expect <<-\EOF && - line 1 - new line 2 - line 3 - EOF - test_must_fail git rebase main side && - git rebase --abort && - git rebase --ignore-whitespace main side && - test_cmp expect file -' - -test_expect_success '--ignore-whitespace works with interactive backend' ' - cat >expect <<-\EOF && - line 1 - new line 2 - line 3 - EOF - test_must_fail git rebase --merge main side && - git rebase --abort && - git rebase --merge --ignore-whitespace main side && - test_cmp expect file -' - -test_expect_success '--committer-date-is-author-date works with am backend' ' - git commit --amend && - git rebase --committer-date-is-author-date HEAD^ && - git show HEAD --pretty="format:%ai" >authortime && - git show HEAD --pretty="format:%ci" >committertime && - test_cmp authortime committertime -' - -test_expect_success '--committer-date-is-author-date works with interactive backend' ' - git commit --amend && - git rebase -i --committer-date-is-author-date HEAD^ && - git show HEAD --pretty="format:%ai" >authortime && - git show HEAD --pretty="format:%ci" >committertime && - test_cmp authortime committertime -' - -test_expect_success '--committer-date-is-author-date works with rebase -r' ' - git checkout side && - git merge --no-ff commit3 && - git rebase -r --root --committer-date-is-author-date && - git rev-list HEAD >rev_list && - while read HASH - do - git show $HASH --pretty="format:%ai" >authortime - git show $HASH --pretty="format:%ci" >committertime - test_cmp authortime committertime - done <rev_list -' - -# Checking for +0000 in author time is enough since default -# timezone is UTC, but the timezone used while committing -# sets to +0530. -test_expect_success '--ignore-date works with am backend' ' - git commit --amend --date="$GIT_AUTHOR_DATE" && - git rebase --ignore-date HEAD^ && - git show HEAD --pretty="format:%ai" >authortime && - grep "+0000" authortime -' - -test_expect_success '--ignore-date works with interactive backend' ' - git commit --amend --date="$GIT_AUTHOR_DATE" && - git rebase --ignore-date -i HEAD^ && - git show HEAD --pretty="format:%ai" >authortime && - grep "+0000" authortime -' - -test_expect_success '--ignore-date works with rebase -r' ' - git checkout side && - git merge --no-ff commit3 && - git rebase -r --root --ignore-date && - git rev-list HEAD >rev_list && - while read HASH - do - git show $HASH --pretty="format:%ai" >authortime - grep "+0000" authortime - done <rev_list -' - -test_done diff --git a/t/t4215-log-skewed-merges.sh b/t/t4215-log-skewed-merges.sh index 18709a723e..5661ed5881 100755 --- a/t/t4215-log-skewed-merges.sh +++ b/t/t4215-log-skewed-merges.sh @@ -240,4 +240,75 @@ test_expect_success 'log --graph with octopus merge with column joining its penu EOF ' +test_expect_success 'log --graph with multiple tips' ' + git checkout --orphan 6_1 && + test_commit 6_A && + git branch 6_2 && + git branch 6_4 && + test_commit 6_B && + git branch 6_3 && + test_commit 6_C && + git checkout 6_2 && test_commit 6_D && + git checkout 6_3 && test_commit 6_E && + git checkout -b 6_5 6_1 && + git merge --no-ff 6_2 -m 6_F && + git checkout 6_4 && test_commit 6_G && + git checkout 6_3 && + git merge --no-ff 6_4 -m 6_H && + git checkout 6_1 && + git merge --no-ff 6_2 -m 6_I && + + check_graph 6_1 6_3 6_5 <<-\EOF + * 6_I + |\ + | | * 6_H + | | |\ + | | | * 6_G + | | * | 6_E + | | | | * 6_F + | |_|_|/| + |/| | |/ + | | |/| + | |/| | + | * | | 6_D + | | |/ + | |/| + * | | 6_C + | |/ + |/| + * | 6_B + |/ + * 6_A + EOF +' + +test_expect_success 'log --graph with multiple tips and colors' ' + test_config log.graphColors red,green,yellow,blue,magenta,cyan && + cat >expect.colors <<-\EOF && + * 6_I + <RED>|<RESET><GREEN>\<RESET> + <RED>|<RESET> <GREEN>|<RESET> * 6_H + <RED>|<RESET> <GREEN>|<RESET> <YELLOW>|<RESET><BLUE>\<RESET> + <RED>|<RESET> <GREEN>|<RESET> <YELLOW>|<RESET> * 6_G + <RED>|<RESET> <GREEN>|<RESET> <YELLOW>|<RESET> <BLUE>|<RESET> * 6_F + <RED>|<RESET> <GREEN>|<RESET><RED>_<RESET><YELLOW>|<RESET><RED>_<RESET><BLUE>|<RESET><RED>/<RESET><GREEN>|<RESET> + <RED>|<RESET><RED>/<RESET><GREEN>|<RESET> <YELLOW>|<RESET> <BLUE>|<RESET><GREEN>/<RESET> + <RED>|<RESET> <GREEN>|<RESET> <YELLOW>|<RESET><GREEN>/<RESET><BLUE>|<RESET> + <RED>|<RESET> <GREEN>|<RESET><GREEN>/<RESET><YELLOW>|<RESET> <BLUE>|<RESET> + <RED>|<RESET> <GREEN>|<RESET> * <BLUE>|<RESET> 6_E + <RED>|<RESET> * <CYAN>|<RESET> <BLUE>|<RESET> 6_D + <RED>|<RESET> <BLUE>|<RESET> <CYAN>|<RESET><BLUE>/<RESET> + <RED>|<RESET> <BLUE>|<RESET><BLUE>/<RESET><CYAN>|<RESET> + * <BLUE>|<RESET> <CYAN>|<RESET> 6_C + <CYAN>|<RESET> <BLUE>|<RESET><CYAN>/<RESET> + <CYAN>|<RESET><CYAN>/<RESET><BLUE>|<RESET> + * <BLUE>|<RESET> 6_B + <BLUE>|<RESET><BLUE>/<RESET> + * 6_A + EOF + git log --color=always --graph --date-order --pretty=tformat:%s 6_1 6_3 6_5 >actual.colors.raw && + test_decode_color <actual.colors.raw | sed "s/ *\$//" >actual.colors && + test_cmp expect.colors actual.colors +' + test_done diff --git a/t/t7415-submodule-names.sh b/t/t7415-submodule-names.sh index 905a557585..f70368bc2e 100755 --- a/t/t7415-submodule-names.sh +++ b/t/t7415-submodule-names.sh @@ -207,6 +207,9 @@ test_expect_success MINGW 'prevent git~1 squatting on Windows' ' git hash-object -w --stdin)" && rev="$(git rev-parse --verify HEAD)" && hash="$(echo x | git hash-object -w --stdin)" && + test_must_fail git update-index --add \ + --cacheinfo 160000,$rev,d\\a 2>err && + test_i18ngrep "Invalid path" err && git -c core.protectNTFS=false update-index --add \ --cacheinfo 100644,$modules,.gitmodules \ --cacheinfo 160000,$rev,c \ @@ -214,9 +217,7 @@ test_expect_success MINGW 'prevent git~1 squatting on Windows' ' --cacheinfo 100644,$hash,d./a/x \ --cacheinfo 100644,$hash,d./a/..git && test_tick && - git -c core.protectNTFS=false commit -m "module" && - test_must_fail git show HEAD: 2>err && - test_i18ngrep backslash err + git -c core.protectNTFS=false commit -m "module" ) && test_must_fail git -c core.protectNTFS=false \ clone --recurse-submodules squatting squatting-clone 2>err && |