summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/.gitattributes1
-rw-r--r--t/README12
-rw-r--r--t/annotate-tests.sh262
-rw-r--r--t/gitweb-lib.sh2
-rwxr-xr-xt/lib-credential.sh4
-rw-r--r--t/lib-git-p4.sh3
-rw-r--r--t/lib-git-svn.sh4
-rw-r--r--t/lib-httpd.sh19
-rw-r--r--t/lib-httpd/apache.conf8
-rw-r--r--t/lib-pack.sh100
-rw-r--r--t/lib-read-tree.sh52
-rw-r--r--t/lib-terminal.sh4
-rwxr-xr-xt/t0008-ignores.sh110
-rwxr-xr-xt/t0050-filesystem.sh1
-rwxr-xr-xt/t0056-git-C.sh84
-rwxr-xr-xt/t0060-path-utils.sh64
-rwxr-xr-xt/t0070-fundamental.sh4
-rwxr-xr-xt/t0110-urlmatch-normalization.sh177
-rw-r--r--t/t0110/README9
-rw-r--r--t/t0110/url-11
-rw-r--r--t/t0110/url-101
-rw-r--r--t/t0110/url-111
-rw-r--r--t/t0110/url-21
-rw-r--r--t/t0110/url-31
-rw-r--r--t/t0110/url-41
-rw-r--r--t/t0110/url-51
-rw-r--r--t/t0110/url-61
-rw-r--r--t/t0110/url-71
-rw-r--r--t/t0110/url-81
-rw-r--r--t/t0110/url-91
-rwxr-xr-xt/t0202-gettext-perl.sh4
-rwxr-xr-xt/t1005-read-tree-reset.sh141
-rwxr-xr-xt/t1006-cat-file.sh43
-rwxr-xr-xt/t1010-mktree.sh4
-rwxr-xr-xt/t1300-repo-config.sh38
-rwxr-xr-xt/t1400-update-ref.sh632
-rwxr-xr-xt/t1506-rev-parse-diagnosis.sh24
-rwxr-xr-xt/t1508-at-combinations.sh8
-rwxr-xr-xt/t1511-rev-parse-caret.sh7
-rwxr-xr-xt/t2008-checkout-subdir.sh14
-rwxr-xr-xt/t3001-ls-files-others-exclude.sh2
-rwxr-xr-xt/t3200-branch.sh15
-rwxr-xr-xt/t3300-funny-names.sh6
-rwxr-xr-xt/t3501-revert-cherry-pick.sh34
-rwxr-xr-xt/t3506-cherry-pick-ff.sh2
-rwxr-xr-xt/t3509-cherry-pick-merge-df.sh2
-rwxr-xr-xt/t3600-rm.sh109
-rwxr-xr-xt/t3701-add-interactive.sh76
-rwxr-xr-xt/t3910-mac-os-precompose.sh2
-rwxr-xr-xt/t4014-format-patch.sh2
-rwxr-xr-xt/t4015-diff-whitespace.sh5
-rwxr-xr-xt/t4020-diff-external.sh2
-rwxr-xr-xt/t4029-diff-trailing-space.sh2
-rwxr-xr-xt/t4030-diff-textconv.sh24
-rwxr-xr-xt/t4055-diff-context.sh2
-rwxr-xr-xt/t4103-apply-binary.sh4
-rwxr-xr-xt/t4116-apply-reverse.sh4
-rwxr-xr-xt/t4200-rerere.sh10
-rwxr-xr-xt/t4208-log-magic-pathspec.sh15
-rwxr-xr-xt/t4211-line-log.sh33
-rwxr-xr-xt/t5300-pack-object.sh18
-rwxr-xr-xt/t5303-pack-corruption-resilience.sh4
-rwxr-xr-xt/t5308-pack-detect-duplicates.sh80
-rwxr-xr-xt/t5309-pack-delta-cycles.sh77
-rwxr-xr-xt/t5500-fetch-pack.sh87
-rwxr-xr-xt/t5510-fetch.sh82
-rwxr-xr-xt/t5516-fetch-push.sh17
-rwxr-xr-xt/t5520-pull.sh89
-rwxr-xr-xt/t5533-push-cas.sh189
-rwxr-xr-xt/t5541-http-push.sh2
-rwxr-xr-xt/t5551-http-fetch.sh18
-rwxr-xr-xt/t5601-clone.sh136
-rwxr-xr-xt/t5800-remote-testpy.sh169
-rwxr-xr-xt/t5801-remote-helpers.sh11
-rwxr-xr-xt/t6011-rev-list-with-bad-commit.sh2
-rwxr-xr-xt/t6013-rev-list-reverse-parents.sh4
-rwxr-xr-xt/t6022-merge-rename.sh14
-rwxr-xr-xt/t6040-tracking-info.sh109
-rwxr-xr-xt/t6050-replace.sh25
-rwxr-xr-xt/t6101-rev-parse-parents.sh113
-rwxr-xr-xt/t6130-pathspec-noglob.sh94
-rwxr-xr-xt/t6131-pathspec-icase.sh109
-rwxr-xr-xt/t6300-for-each-ref.sh4
-rwxr-xr-xt/t6500-gc.sh5
-rwxr-xr-xt/t7001-mv.sh183
-rwxr-xr-xt/t7008-grep-binary.sh31
-rwxr-xr-xt/t7009-filter-branch-null-sha1.sh49
-rwxr-xr-xt/t7060-wtstatus.sh109
-rwxr-xr-xt/t7105-reset-patch.sh10
-rwxr-xr-xt/t7106-reset-unborn-branch.sh34
-rwxr-xr-xt/t7400-submodule-basic.sh21
-rwxr-xr-xt/t7401-submodule-summary.sh30
-rwxr-xr-xt/t7407-submodule-foreach.sh4
-rwxr-xr-xt/t7501-commit.sh2
-rwxr-xr-xt/t7507-commit-verbose.sh28
-rwxr-xr-xt/t7508-status.sh972
-rwxr-xr-xt/t7512-status-help.sh602
-rwxr-xr-xt/t7610-mergetool.sh6
-rwxr-xr-xt/t8007-cat-file-textconv.sh20
-rwxr-xr-xt/t9001-send-email.sh1
-rwxr-xr-xt/t9114-git-svn-dcommit-merge.sh2
-rwxr-xr-xt/t9117-git-svn-init-clone.sh67
-rwxr-xr-xt/t9129-git-svn-i18n-commitencoding.sh2
-rwxr-xr-xt/t9137-git-svn-dcommit-clobber-series.sh8
-rwxr-xr-xt/t9300-fast-import.sh73
-rwxr-xr-xt/t9350-fast-export.sh2
-rwxr-xr-xt/t9400-git-cvsserver-server.sh2
-rwxr-xr-xt/t9401-git-cvsserver-crlf.sh2
-rwxr-xr-xt/t9402-git-cvsserver-refs.sh2
-rwxr-xr-xt/t9500-gitweb-standalone-no-errors.sh8
-rwxr-xr-xt/t9700-perl-git.sh4
-rwxr-xr-xt/t9810-git-p4-rcs.sh2
-rwxr-xr-xt/t9903-bash-prompt.sh23
-rw-r--r--t/test-lib-functions.sh76
-rw-r--r--t/test-lib.sh143
115 files changed, 4667 insertions, 1506 deletions
diff --git a/t/.gitattributes b/t/.gitattributes
index 1b97c5465b..2d44088f56 100644
--- a/t/.gitattributes
+++ b/t/.gitattributes
@@ -1 +1,2 @@
t[0-9][0-9][0-9][0-9]/* -whitespace
+t0110/url-* binary
diff --git a/t/README b/t/README
index 0a939ebba0..caeeb9dedc 100644
--- a/t/README
+++ b/t/README
@@ -340,7 +340,11 @@ Don't:
- use perl without spelling it as "$PERL_PATH". This is to help our
friends on Windows where the platform Perl often adds CR before
the end of line, and they bundle Git with a version of Perl that
- does not do so, whose path is specified with $PERL_PATH.
+ does not do so, whose path is specified with $PERL_PATH. Note that we
+ provide a "perl" function which uses $PERL_PATH under the hood, so
+ you do not need to worry when simply running perl in the test scripts
+ (but you do, for example, on a shebang line or in a sub script
+ created via "write_script").
- use sh without spelling it as "$SHELL_PATH", when the script can
be misinterpreted by broken platform shell (e.g. Solaris).
@@ -387,7 +391,7 @@ of the test_* functions (see the "Test harness library" section
below), e.g.:
test_expect_success PERL 'I need Perl' '
- "$PERL_PATH" -e "hlagh() if unf_unf()"
+ perl -e "hlagh() if unf_unf()"
'
The advantage of skipping tests like this is that platforms that don't
@@ -520,7 +524,7 @@ library for your script to use.
test_external \
'GitwebCache::*FileCache*' \
- "$PERL_PATH" "$TEST_DIRECTORY"/t9503/test_cache_interface.pl
+ perl "$TEST_DIRECTORY"/t9503/test_cache_interface.pl
If the test is outputting its own TAP you should set the
test_external_has_tap variable somewhere before calling the first
@@ -536,7 +540,7 @@ library for your script to use.
test_external_without_stderr \
'Perl API' \
- "$PERL_PATH" "$TEST_DIRECTORY"/t9700/test.pl
+ perl "$TEST_DIRECTORY"/t9700/test.pl
- test_expect_code <exit-code> <command>
diff --git a/t/annotate-tests.sh b/t/annotate-tests.sh
index d4e7f4736f..c9d105d707 100644
--- a/t/annotate-tests.sh
+++ b/t/annotate-tests.sh
@@ -92,7 +92,7 @@ test_expect_success 'blame 2 authors + 1 branch2 author' '
'
test_expect_success 'merge branch1 & branch2' '
- git pull . branch1
+ git merge branch1
'
test_expect_success 'blame 2 authors + 2 merged-in authors' '
@@ -185,6 +185,26 @@ test_expect_success 'blame -L Y,X (undocumented)' '
check_count -L6,3 B 1 B1 1 B2 1 D 1
'
+test_expect_success 'blame -L -X' '
+ test_must_fail $PROG -L-1 file
+'
+
+test_expect_success 'blame -L 0' '
+ test_must_fail $PROG -L0 file
+'
+
+test_expect_success 'blame -L ,0' '
+ test_must_fail $PROG -L,0 file
+'
+
+test_expect_success 'blame -L ,+0' '
+ test_must_fail $PROG -L,+0 file
+'
+
+test_expect_success 'blame -L X,+0' '
+ test_must_fail $PROG -L1,+0 file
+'
+
test_expect_success 'blame -L X,+1' '
check_count -L3,+1 B2 1
'
@@ -193,6 +213,14 @@ test_expect_success 'blame -L X,+N' '
check_count -L3,+4 B 1 B1 1 B2 1 D 1
'
+test_expect_success 'blame -L ,-0' '
+ test_must_fail $PROG -L,-0 file
+'
+
+test_expect_success 'blame -L X,-0' '
+ test_must_fail $PROG -L1,-0 file
+'
+
test_expect_success 'blame -L X,-1' '
check_count -L3,-1 B2 1
'
@@ -225,14 +253,105 @@ test_expect_success 'blame -L /RE/,-N' '
check_count -L/99/,-3 B 1 B2 1 D 1
'
+# 'file' ends with an incomplete line, so 'wc' reports one fewer lines than
+# git-blame sees, hence the last line is actually $(wc...)+1.
+test_expect_success 'blame -L X (X == nlines)' '
+ n=$(expr $(wc -l <file) + 1) &&
+ check_count -L$n C 1
+'
+
+test_expect_success 'blame -L X (X == nlines + 1)' '
+ n=$(expr $(wc -l <file) + 2) &&
+ test_must_fail $PROG -L$n file
+'
+
test_expect_success 'blame -L X (X > nlines)' '
test_must_fail $PROG -L12345 file