diff options
Diffstat (limited to 't')
-rwxr-xr-x | t/t3902-quoted.sh | 8 | ||||
-rwxr-xr-x | t/t3903-stash.sh | 9 | ||||
-rwxr-xr-x | t/t5300-pack-object.sh | 2 | ||||
-rwxr-xr-x | t/t7002-grep.sh | 33 | ||||
-rwxr-xr-x | t/t8003-blame.sh | 10 |
5 files changed, 57 insertions, 5 deletions
diff --git a/t/t3902-quoted.sh b/t/t3902-quoted.sh index 14da45fe5a..29103f65dc 100755 --- a/t/t3902-quoted.sh +++ b/t/t3902-quoted.sh @@ -25,7 +25,7 @@ for_each_name () { for name in \ Name "Name and a${LF}LF" "Name and an${HT}HT" "Name${DQ}" \ "$FN$HT$GN" "$FN$LF$GN" "$FN $GN" "$FN$GN" "$FN$DQ$GN" \ - "With SP in it" "caractère spécial/file" + "With SP in it" "$FN/file" do eval "$1" done @@ -33,7 +33,7 @@ for_each_name () { test_expect_success setup ' - mkdir "caractère spécial" && + mkdir "$FN" && for_each_name "echo initial >\"\$name\"" git add . && git commit -q -m Initial && @@ -51,11 +51,11 @@ Name "Name and an\tHT" "Name\"" With SP in it -"caract\303\250re sp\303\251cial/file" "\346\277\261\351\207\216\t\347\264\224" "\346\277\261\351\207\216\n\347\264\224" "\346\277\261\351\207\216 \347\264\224" "\346\277\261\351\207\216\"\347\264\224" +"\346\277\261\351\207\216/file" "\346\277\261\351\207\216\347\264\224" EOF @@ -65,11 +65,11 @@ Name "Name and an\tHT" "Name\"" With SP in it -caractère spécial/file "濱野\t純" "濱野\n純" 濱野 純 "濱野\"純" +濱野/file 濱野純 EOF diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh index 5514f74b30..476e5ec038 100755 --- a/t/t3903-stash.sh +++ b/t/t3903-stash.sh @@ -194,6 +194,15 @@ test_expect_success 'pop -q is quiet' ' test ! -s output.out ' +test_expect_success 'pop -q --index works and is quiet' ' + echo foo > file && + git add file && + git stash save --quiet && + git stash pop -q --index > output.out 2>&1 && + test foo = "$(git show :file)" && + test ! -s output.out +' + test_expect_success 'drop -q is quiet' ' git stash && git stash drop -q > output.out 2>&1 && diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh index 1058d981dc..7649b810b1 100755 --- a/t/t5300-pack-object.sh +++ b/t/t5300-pack-object.sh @@ -389,7 +389,7 @@ test_expect_success 'verify resulting packs' ' test_expect_success 'tolerate packsizelimit smaller than biggest object' ' git config pack.packSizeLimit 1 && packname_11=$(git pack-objects test-11 <obj-list) && - test 3 = $(ls test-11-*.pack | wc -l) + test 5 = $(ls test-11-*.pack | wc -l) ' test_expect_success 'verify resulting packs' ' diff --git a/t/t7002-grep.sh b/t/t7002-grep.sh index 7144f815c0..0b583cbfc1 100755 --- a/t/t7002-grep.sh +++ b/t/t7002-grep.sh @@ -434,4 +434,37 @@ test_expect_success 'grep -Fi' ' test_cmp expected actual ' +test_expect_success 'setup double-dash tests' ' +cat >double-dash <<EOF && +-- +-> +other +EOF +git add double-dash +' + +cat >expected <<EOF +double-dash:-> +EOF +test_expect_success 'grep -- pattern' ' + git grep -- "->" >actual && + test_cmp expected actual +' +test_expect_success 'grep -- pattern -- pathspec' ' + git grep -- "->" -- double-dash >actual && + test_cmp expected actual +' +test_expect_success 'grep -e pattern -- path' ' + git grep -e "->" -- double-dash >actual && + test_cmp expected actual +' + +cat >expected <<EOF +double-dash:-- +EOF +test_expect_success 'grep -e -- -- path' ' + git grep -e -- -- double-dash >actual && + test_cmp expected actual +' + test_done diff --git a/t/t8003-blame.sh b/t/t8003-blame.sh index ad834f200a..3bbddd03cb 100755 --- a/t/t8003-blame.sh +++ b/t/t8003-blame.sh @@ -157,4 +157,14 @@ EOF git --no-pager blame $COMMIT -- uno >/dev/null ' +test_expect_success 'blame -L with invalid start' ' + test_must_fail git blame -L5 tres 2>errors && + grep "has only 2 lines" errors +' + +test_expect_success 'blame -L with invalid end' ' + test_must_fail git blame -L1,5 tres 2>errors && + grep "has only 2 lines" errors +' + test_done |