summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/annotate-tests.sh4
-rw-r--r--t/gitweb-lib.sh2
-rw-r--r--t/lib-t6000.sh2
-rw-r--r--t/perf/perf-lib.sh4
-rwxr-xr-xt/t1006-cat-file.sh7
-rwxr-xr-xt/t1508-at-combinations.sh2
-rwxr-xr-xt/t3900-i18n-commit.sh4
-rw-r--r--t/t3900/UTF-16.txtbin0 -> 146 bytes
-rwxr-xr-xt/t3903-stash.sh18
-rwxr-xr-xt/t5500-fetch-pack.sh16
-rwxr-xr-xt/t7301-clean-interactive.sh40
-rwxr-xr-xt/t7407-submodule-foreach.sh2
-rwxr-xr-xt/t7601-merge-pull-config.sh2
-rwxr-xr-xt/t9020-remote-svn.sh2
-rwxr-xr-xt/t9112-git-svn-md5less-file.sh2
-rwxr-xr-xt/t9300-fast-import.sh65
-rwxr-xr-xt/t9802-git-p4-filetype.sh2
-rwxr-xr-xt/t9902-completion.sh2
18 files changed, 133 insertions, 43 deletions
diff --git a/t/annotate-tests.sh b/t/annotate-tests.sh
index 0bfee001b4..d4e7f4736f 100644
--- a/t/annotate-tests.sh
+++ b/t/annotate-tests.sh
@@ -245,8 +245,8 @@ test_expect_success 'setup -L :regex' '
git commit -m "hello" &&
mv hello.c hello.orig &&
- sed -e "/}/i\\
- Qputs(\"goodbye\");" <hello.orig | tr Q "\\t" >hello.c &&
+ sed -e "/}/ {x; s/$/Qputs(\"goodbye\");/; G;}" <hello.orig |
+ tr Q "\\t" >hello.c &&
GIT_AUTHOR_NAME="G" GIT_AUTHOR_EMAIL="G@test.git" \
git commit -a -m "goodbye" &&
diff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh
index ae2dc4604f..9e381e000f 100644
--- a/t/gitweb-lib.sh
+++ b/t/gitweb-lib.sh
@@ -36,7 +36,7 @@ EOF
# You can set the GITWEB_TEST_INSTALLED environment variable to
# the gitwebdir (the directory where gitweb is installed / deployed to)
- # of an existing gitweb instalation to test that installation,
+ # of an existing gitweb installation to test that installation,
# or simply to pathname of installed gitweb script.
if test -n "$GITWEB_TEST_INSTALLED" ; then
if test -d $GITWEB_TEST_INSTALLED; then
diff --git a/t/lib-t6000.sh b/t/lib-t6000.sh
index 4ffd90127e..3f2d873fec 100644
--- a/t/lib-t6000.sh
+++ b/t/lib-t6000.sh
@@ -34,7 +34,7 @@ save_tag () {
mv sed.script.tmp sed.script
}
-# Replace unhelpful sha1 hashses with their symbolic equivalents
+# Replace unhelpful sha1 hashes with their symbolic equivalents
entag () {
sed -f sed.script
}
diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh
index c61d5351e1..f4eecaa171 100644
--- a/t/perf/perf-lib.sh
+++ b/t/perf/perf-lib.sh
@@ -161,7 +161,7 @@ test_perf () {
echo "$test_count" >>"$perf_results_dir"/$base.subtests
echo "$1" >"$perf_results_dir"/$base.$test_count.descr
if test -z "$verbose"; then
- echo -n "perf $test_count - $1:"
+ printf "%s" "perf $test_count - $1:"
else
echo "perf $test_count - $1:"
fi
@@ -170,7 +170,7 @@ test_perf () {
if test_run_perf_ "$2"
then
if test -z "$verbose"; then
- echo -n " $i"
+ printf " %s" "$i"
else
echo "* timing run $i/$GIT_PERF_REPEAT_COUNT:"
fi
diff --git a/t/t1006-cat-file.sh b/t/t1006-cat-file.sh
index d499d02a29..4e911fb43d 100755
--- a/t/t1006-cat-file.sh
+++ b/t/t1006-cat-file.sh
@@ -78,13 +78,6 @@ $content"
echo $sha1 | git cat-file --batch-check="%(objecttype) %(objectname)" >actual &&
test_cmp expect actual
'
-
- test_expect_success '--batch-check with %(rest)' '
- echo "$type this is some extra content" >expect &&
- echo "$sha1 this is some extra content" |
- git cat-file --batch-check="%(objecttype) %(rest)" >actual &&
- test_cmp expect actual
- '
}
hello_content="Hello World"
diff --git a/t/t1508-at-combinations.sh b/t/t1508-at-combinations.sh
index 4db1613f8a..e5aea3b896 100755
--- a/t/t1508-at-combinations.sh
+++ b/t/t1508-at-combinations.sh
@@ -55,8 +55,6 @@ check "HEAD@{u}" ref refs/heads/upstream-branch
check "@{u}@{1}" commit upstream-one
check "@{-1}@{u}" ref refs/heads/master
check "@{-1}@{u}@{1}" commit master-one
-check "@" commit new-two
-check "@@{u}" ref refs/heads/upstream-branch
nonsense "@{u}@{-1}"
nonsense "@{0}@{0}"
nonsense "@{1}@{u}"
diff --git a/t/t3900-i18n-commit.sh b/t/t3900-i18n-commit.sh
index 38b00c37b0..4bf1dbe9c9 100755
--- a/t/t3900-i18n-commit.sh
+++ b/t/t3900-i18n-commit.sh
@@ -34,9 +34,9 @@ test_expect_success 'no encoding header for base case' '
test z = "z$E"
'
-test_expect_failure 'UTF-16 refused because of NULs' '
+test_expect_success 'UTF-16 refused because of NULs' '
echo UTF-16 >F &&
- git commit -a -F "$TEST_DIRECTORY"/t3900/UTF-16.txt
+ test_must_fail git commit -a -F "$TEST_DIRECTORY"/t3900/UTF-16.txt
'
test_expect_success 'UTF-8 invalid characters refused' '
diff --git a/t/t3900/UTF-16.txt b/t/t3900/UTF-16.txt
new file mode 100644
index 0000000000..2257f05a99
--- /dev/null
+++ b/t/t3900/UTF-16.txt
Binary files differ
diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
index 5d22f17ca2..debda7a678 100755
--- a/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
@@ -673,22 +673,4 @@ test_expect_success 'store updates stash ref and reflog' '
grep quux bazzy
'
-test_expect_success 'stash a change to turn a non-directory to a directory' '
- git reset --hard &&
- >testfile &&
- git add testfile &&
- git commit -m "add testfile as a regular file" &&
- rm testfile &&
- mkdir testfile &&
- >testfile/file &&
- test_must_fail git stash save "recover regular file" &&
- test -f testfile/file
-'
-
-test_expect_success 'stash a change to turn a non-directory to a directory (forced)' '
- git stash save --force "recover regular file (forced)" &&
- ! test -f testfile/file &&
- test -f testfile
-'
-
test_done
diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
index fd2598e601..a80584ea0e 100755
--- a/t/t5500-fetch-pack.sh
+++ b/t/t5500-fetch-pack.sh
@@ -505,4 +505,20 @@ test_expect_success 'test --all, --depth, and explicit tag' '
) >out-adt 2>error-adt
'
+test_expect_success 'shallow fetch with tags does not break the repository' '
+ mkdir repo1 &&
+ (
+ cd repo1 &&
+ git init &&
+ test_commit 1 &&
+ test_commit 2 &&
+ test_commit 3 &&
+ mkdir repo2 &&
+ cd repo2 &&
+ git init &&
+ git fetch --depth=2 ../.git master:branch &&
+ git fsck
+ )
+'
+
test_done
diff --git a/t/t7301-clean-interactive.sh b/t/t7301-clean-interactive.sh
index 4e6055d06a..3ae394e934 100755
--- a/t/t7301-clean-interactive.sh
+++ b/t/t7301-clean-interactive.sh
@@ -17,7 +17,7 @@ test_expect_success 'setup' '
'
-test_expect_success 'git clean -i (clean)' '
+test_expect_success 'git clean -i (c: clean hotkey)' '
mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
@@ -38,12 +38,33 @@ test_expect_success 'git clean -i (clean)' '
'
+test_expect_success 'git clean -i (cl: clean prefix)' '
+
+ mkdir -p build docs &&
+ touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
+ docs/manual.txt obj.o build/lib.so &&
+ echo cl | git clean -i &&
+ test -f Makefile &&
+ test -f README &&
+ test -f src/part1.c &&
+ test -f src/part2.c &&
+ test ! -f a.out &&
+ test -f docs/manual.txt &&
+ test ! -f src/part3.c &&
+ test ! -f src/part3.h &&
+ test ! -f src/part4.c &&
+ test ! -f src/part4.h &&
+ test -f obj.o &&
+ test -f build/lib.so
+
+'
+
test_expect_success 'git clean -i (quit)' '
mkdir -p build docs &&
touch a.out src/part3.c src/part3.h src/part4.c src/part4.h \
docs/manual.txt obj.o build/lib.so &&
- echo q | git clean -i &&
+ echo quit | git clean -i &&
test -f Makefile &&
test -f README &&
test -f src/part1.c &&
@@ -256,6 +277,21 @@ test_expect_success 'git clean -id (select - number 3)' '
'
+test_expect_success 'git clean -id (select - filenames)' '
+
+ mkdir -p build docs &&
+ touch a.out foo.txt bar.txt baz.txt &&
+ (echo s; echo a.out fo ba bar; echo; echo c) | \
+ git clean -id &&
+ test -f Makefile &&
+ test ! -f a.out &&
+ test ! -f foo.txt &&
+ test ! -f bar.txt &&
+ test -f baz.txt &&
+ rm baz.txt
+
+'
+
test_expect_success 'git clean -id (select - range)' '
mkdir -p build docs &&
diff --git a/t/t7407-submodule-foreach.sh b/t/t7407-submodule-foreach.sh
index 91d4fd1fac..be93f10cf0 100755
--- a/t/t7407-submodule-foreach.sh
+++ b/t/t7407-submodule-foreach.sh
@@ -145,7 +145,7 @@ test_expect_success 'use "submodule foreach" to checkout 2nd level submodule' '
git rev-parse --resolve-git-dir nested1/.git &&
test_must_fail git rev-parse --resolve-git-dir nested1/nested2/.git &&
git submodule foreach "git submodule update --init" &&
- git rev-parse --resolve-git-dir nested1/nested1/nested2/.git
+ git rev-parse --resolve-git-dir nested1/nested2/.git &&
test_must_fail git rev-parse --resolve-git-dir nested1/nested2/nested3/.git
)
'
diff --git a/t/t7601-merge-pull-config.sh b/t/t7601-merge-pull-config.sh
index 25dac79889..830a4c3e9d 100755
--- a/t/t7601-merge-pull-config.sh
+++ b/t/t7601-merge-pull-config.sh
@@ -109,7 +109,7 @@ test_expect_success 'setup conflicted merge' '
'
# First do the merge with resolve and recursive then verify that
-# recusive is chosen.
+# recursive is chosen.
test_expect_success 'merge picks up the best result' '
git config --unset-all pull.twohead &&
diff --git a/t/t9020-remote-svn.sh b/t/t9020-remote-svn.sh
index d9f6b73ab0..4d81ba1c2c 100755
--- a/t/t9020-remote-svn.sh
+++ b/t/t9020-remote-svn.sh
@@ -24,7 +24,7 @@ init_git () {
rm -fr .git &&
git init &&
#git remote add svnsim testsvn::sim:///$TEST_DIRECTORY/t9020/example.svnrdump
- # let's reuse an exisiting dump file!?
+ # let's reuse an existing dump file!?
git remote add svnsim testsvn::sim://$TEST_DIRECTORY/t9154/svn.dump
git remote add svnfile testsvn::file://$TEST_DIRECTORY/t9154/svn.dump
}
diff --git a/t/t9112-git-svn-md5less-file.sh b/t/t9112-git-svn-md5less-file.sh
index a61d6716d2..9861c719f8 100755
--- a/t/t9112-git-svn-md5less-file.sh
+++ b/t/t9112-git-svn-md5less-file.sh
@@ -7,7 +7,7 @@ test_description='test that git handles an svn repository with missing md5sums'
# Loading a node from a svn dumpfile without a Text-Content-Length
# field causes svn to neglect to store or report an md5sum. (it will
# calculate one if you had put Text-Content-Length: 0). This showed
-# up in a repository creted with cvs2svn.
+# up in a repository created with cvs2svn.
cat > dumpfile.svn <<EOF
SVN-fs-dump-format-version: 1
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index ac6f3b6af2..31a770d9bc 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -1031,6 +1031,32 @@ test_expect_success \
git diff-tree -M -r M3^ M3 >actual &&
compare_diff_raw expect actual'
+cat >input <<INPUT_END
+commit refs/heads/M4
+committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
+data <<COMMIT
+rename root
+COMMIT
+
+from refs/heads/M2^0
+R "" sub
+
+INPUT_END
+
+cat >expect <<EOF
+:100644 100644 7123f7f44e39be127c5eb701e5968176ee9d78b1 7123f7f44e39be127c5eb701e5968176ee9d78b1 R100 file2/oldf sub/file2/oldf
+:100755 100755 85df50785d62d3b05ab03d9cbf7e4a0b49449730 85df50785d62d3b05ab03d9cbf7e4a0b49449730 R100 file4 sub/file4
+:100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc R100 i/am/new/to/you sub/i/am/new/to/you
+:100755 100755 e74b7d465e52746be2b4bae983670711e6e66657 e74b7d465e52746be2b4bae983670711e6e66657 R100 newdir/exec.sh sub/newdir/exec.sh
+:100644 100644 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 R100 newdir/interesting sub/newdir/interesting
+EOF
+test_expect_success \
+ 'M: rename root to subdirectory' \
+ 'git fast-import <input &&
+ git diff-tree -M -r M4^ M4 >actual &&
+ cat actual &&
+ compare_diff_raw expect actual'
+
###
### series N
###
@@ -1228,6 +1254,29 @@ test_expect_success \
compare_diff_raw expect actual'
test_expect_success \
+ 'N: copy root by path' \
+ 'cat >expect <<-\EOF &&
+ :100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc C100 file2/newf oldroot/file2/newf
+ :100644 100644 7123f7f44e39be127c5eb701e5968176ee9d78b1 7123f7f44e39be127c5eb701e5968176ee9d78b1 C100 file2/oldf oldroot/file2/oldf
+ :100755 100755 85df50785d62d3b05ab03d9cbf7e4a0b49449730 85df50785d62d3b05ab03d9cbf7e4a0b49449730 C100 file4 oldroot/file4
+ :100755 100755 e74b7d465e52746be2b4bae983670711e6e66657 e74b7d465e52746be2b4bae983670711e6e66657 C100 newdir/exec.sh oldroot/newdir/exec.sh
+ :100644 100644 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 C100 newdir/interesting oldroot/newdir/interesting
+ EOF
+ cat >input <<-INPUT_END &&
+ commit refs/heads/N-copy-root-path
+ committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
+ data <<COMMIT
+ copy root directory by (empty) path
+ COMMIT
+
+ from refs/heads/branch^0
+ C "" oldroot
+ INPUT_END
+ git fast-import <input &&
+ git diff-tree -C --find-copies-harder -r branch N-copy-root-path >actual &&
+ compare_diff_raw expect actual'
+
+test_expect_success \
'N: delete directory by copying' \
'cat >expect <<-\EOF &&
OBJID
@@ -2934,4 +2983,20 @@ test_expect_success 'S: ls with garbage after sha1 must fail' '
test_i18ngrep "space after tree-ish" err
'
+###
+### series T (ls)
+###
+# Setup is carried over from series S.
+
+test_expect_success 'T: ls root tree' '
+ sed -e "s/Z\$//" >expect <<-EOF &&
+ 040000 tree $(git rev-parse S^{tree}) Z
+ EOF
+ sha1=$(git rev-parse --verify S) &&
+ git fast-import --import-marks=marks <<-EOF >actual &&
+ ls $sha1 ""
+ EOF
+ test_cmp expect actual
+'
+
test_done
diff --git a/t/t9802-git-p4-filetype.sh b/t/t9802-git-p4-filetype.sh
index b0d1d94bf4..a82744bab0 100755
--- a/t/t9802-git-p4-filetype.sh
+++ b/t/t9802-git-p4-filetype.sh
@@ -28,7 +28,7 @@ test_expect_success 'p4 client newlines, unix' '
test_cmp f-unix-orig f-unix &&
# make sure stored in repo as unix newlines
- # use sed to eat python-appened newline
+ # use sed to eat python-appended newline
p4 -G print //depot/f-unix | marshal_dump data 2 |\
sed \$d >f-unix-p4-print &&
test_cmp f-unix-orig f-unix-p4-print &&
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index 272a071e85..2d4beb5e50 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -69,7 +69,7 @@ run_completion ()
local -a COMPREPLY _words
local _cword
_words=( $1 )
- test "${1: -1}" = ' ' && _words+=('')
+ test "${1: -1}" = ' ' && _words[${#_words[@]}+1]=''
(( _cword = ${#_words[@]} - 1 ))
__git_wrap__git_main && print_comp
}