diff options
author | Junio C Hamano <junkio@cox.net> | 2006-08-15 03:13:34 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-08-15 03:13:34 -0700 |
commit | d7b6c3c0f54b951c85cd41c6e6571c65cf090111 (patch) | |
tree | 44c009ddd29ab5a986dba9028d0b57a0b2e03201 /t | |
parent | 4c5cf8c44ce06a79da5bafd4a92e6d6f598cea2e (diff) | |
parent | 3cd4f5e8eb04ae01298ceaf46bb41a4277031916 (diff) | |
download | git-d7b6c3c0f54b951c85cd41c6e6571c65cf090111.tar.gz git-d7b6c3c0f54b951c85cd41c6e6571c65cf090111.tar.xz |
Merge branch 'master' into pb/gitpm
* master: (166 commits)
git-apply --binary: clean up and prepare for --reverse
Fix detection of ipv6 on Solaris
Look for sockaddr_storage in sys/socket.h
Solaris has strlcpy() at least since version 8
git-apply --reverse: simplify reverse option.
t4116 apply --reverse test
Make sha1flush void and remove conditional return.
Make upload_pack void and remove conditional return.
Make track_tree_refs void.
Make pack_objects void.
Make fsck_dir void.
Make checkout_all void.
Make show_entry void
Make pprint_tag void and cleans up call in cmd_cat_file.
Remove combine-diff.c::uninteresting()
read-cache.c cleanup
http-push.c cleanup
diff.c cleanup
builtin-push.c cleanup
builtin-grep.c cleanup
...
Diffstat (limited to 't')
-rwxr-xr-x | t/t4013-diff-various.sh | 6 | ||||
-rwxr-xr-x | t/t4115-apply-symlink.sh | 49 | ||||
-rwxr-xr-x | t/t4116-apply-reverse.sh | 46 | ||||
-rwxr-xr-x | t/t7002-grep.sh | 31 |
4 files changed, 128 insertions, 4 deletions
diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh index b24c829f0..71c454356 100755 --- a/t/t4013-diff-various.sh +++ b/t/t4013-diff-various.sh @@ -88,7 +88,7 @@ test_expect_success setup ' +*+ [initial] Initial EOF -V=`git version | sed -e 's/^git version //'` +V=`git version | sed -e 's/^git version //' -e 's/\./\\./g'` while read cmd do case "$cmd" in @@ -103,7 +103,9 @@ do test_expect_success "git $cmd" ' { echo "\$ git $cmd" - git $cmd | sed -e "s/$V/g-i-t--v-e-r-s-i-o-n/" + git $cmd | + sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \ + -e "s/^\\( *boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/" echo "\$" } >"$actual" && if test -f "$expect" diff --git a/t/t4115-apply-symlink.sh b/t/t4115-apply-symlink.sh new file mode 100755 index 000000000..d5f2cfb18 --- /dev/null +++ b/t/t4115-apply-symlink.sh @@ -0,0 +1,49 @@ +#!/bin/sh +# +# Copyright (c) 2005 Junio C Hamano +# + +test_description='git-apply symlinks and partial files + +' + +. ./test-lib.sh + +test_expect_success setup ' + + ln -s path1/path2/path3/path4/path5 link1 && + git add link? && + git commit -m initial && + + git branch side && + + rm -f link? && + + ln -s htap6 link1 && + git update-index link? && + git commit -m second && + + git diff-tree -p HEAD^ HEAD >patch && + git apply --stat --summary patch + +' + +test_expect_success 'apply symlink patch' ' + + git checkout side && + git apply patch && + git diff-files -p >patched && + diff -u patch patched + +' + +test_expect_success 'apply --index symlink patch' ' + + git checkout -f side && + git apply --index patch && + git diff-index --cached -p HEAD >patched && + diff -u patch patched + +' + +test_done diff --git a/t/t4116-apply-reverse.sh b/t/t4116-apply-reverse.sh new file mode 100755 index 000000000..69aebe600 --- /dev/null +++ b/t/t4116-apply-reverse.sh @@ -0,0 +1,46 @@ +#!/bin/sh +# +# Copyright (c) 2005 Junio C Hamano +# + +test_description='git-apply in reverse + +' + +. ./test-lib.sh + +test_expect_success setup ' + + for i in a b c d e f g h i j k l m n; do echo $i; done >file1 && + tr "[ijk]" '\''[\0\1\2]'\'' <file1 >file2 && + + git add file1 file2 && + git commit -m initial && + git tag initial && + + for i in a b c g h i J K L m o n p q; do echo $i; done >file1 && + tr "[mon]" '\''[\0\1\2]'\'' <file1 >file2 && + + git commit -a -m second && + + git diff --binary -R initial >patch + +' + +test_expect_success 'apply in forward' ' + + git apply --index --binary patch && + git diff initial >diff && + diff -u /dev/null diff + +' + +test_expect_success 'apply in reverse' ' + + git apply --reverse --binary --index patch && + git diff >diff && + diff -u /dev/null diff + +' + +test_done diff --git a/t/t7002-grep.sh b/t/t7002-grep.sh index 00a7d762c..6bfb899ed 100755 --- a/t/t7002-grep.sh +++ b/t/t7002-grep.sh @@ -3,7 +3,7 @@ # Copyright (c) 2006 Junio C Hamano # -test_description='git grep -w +test_description='git grep various. ' . ./test-lib.sh @@ -19,7 +19,9 @@ test_expect_success setup ' echo x x xx x >x && echo y yy >y && echo zzz > z && - git add file x y z && + mkdir t && + echo test >t/t && + git add file x y z t/t && git commit -m initial ' @@ -80,6 +82,31 @@ do diff expected actual fi ' + + test_expect_success "grep $L (t-1)" ' + echo "${HC}t/t:1:test" >expected && + git grep -n -e test $H >actual && + diff expected actual + ' + + test_expect_success "grep $L (t-2)" ' + echo "${HC}t:1:test" >expected && + ( + cd t && + git grep -n -e test $H + ) >actual && + diff expected actual + ' + + test_expect_success "grep $L (t-3)" ' + echo "${HC}t/t:1:test" >expected && + ( + cd t && + git grep --full-name -n -e test $H + ) >actual && + diff expected actual + ' + done test_done |