Merge master into aw/mirror-push
This commit is contained in:
@ -205,7 +205,7 @@ test_expect_success \
|
||||
echo $h_TEST >.git/MERGE_HEAD &&
|
||||
GIT_AUTHOR_DATE="2005-05-26 23:45" \
|
||||
GIT_COMMITTER_DATE="2005-05-26 23:45" git-commit -F M &&
|
||||
h_MERGED=$(git rev-parse --verify HEAD)
|
||||
h_MERGED=$(git rev-parse --verify HEAD) &&
|
||||
rm -f M'
|
||||
|
||||
cat >expect <<EOF
|
||||
|
123
t/t3502-cherry-pick-merge.sh
Executable file
123
t/t3502-cherry-pick-merge.sh
Executable file
@ -0,0 +1,123 @@
|
||||
#!/bin/sh
|
||||
|
||||
test_description='cherry picking and reverting a merge
|
||||
|
||||
b---c
|
||||
/ /
|
||||
initial---a
|
||||
|
||||
'
|
||||
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success setup '
|
||||
|
||||
>A &&
|
||||
>B &&
|
||||
git add A B &&
|
||||
git commit -m "Initial" &&
|
||||
git tag initial &&
|
||||
git branch side &&
|
||||
echo new line >A &&
|
||||
git commit -m "add line to A" A &&
|
||||
git tag a &&
|
||||
git checkout side &&
|
||||
echo new line >B &&
|
||||
git commit -m "add line to B" B &&
|
||||
git tag b &&
|
||||
git checkout master &&
|
||||
git merge side &&
|
||||
git tag c
|
||||
|
||||
'
|
||||
|
||||
test_expect_success 'cherry-pick a non-merge with -m should fail' '
|
||||
|
||||
git reset --hard &&
|
||||
git checkout a^0 &&
|
||||
! git cherry-pick -m 1 b &&
|
||||
git diff --exit-code a --
|
||||
|
||||
'
|
||||
|
||||
test_expect_success 'cherry pick a merge without -m should fail' '
|
||||
|
||||
git reset --hard &&
|
||||
git checkout a^0 &&
|
||||
! git cherry-pick c &&
|
||||
git diff --exit-code a --
|
||||
|
||||
'
|
||||
|
||||
test_expect_success 'cherry pick a merge (1)' '
|
||||
|
||||
git reset --hard &&
|
||||
git checkout a^0 &&
|
||||
git cherry-pick -m 1 c &&
|
||||
git diff --exit-code c
|
||||
|
||||
'
|
||||
|
||||
test_expect_success 'cherry pick a merge (2)' '
|
||||
|
||||
git reset --hard &&
|
||||
git checkout b^0 &&
|
||||
git cherry-pick -m 2 c &&
|
||||
git diff --exit-code c
|
||||
|
||||
'
|
||||
|
||||
test_expect_success 'cherry pick a merge relative to nonexistent parent should fail' '
|
||||
|
||||
git reset --hard &&
|
||||
git checkout b^0 &&
|
||||
! git cherry-pick -m 3 c
|
||||
|
||||
'
|
||||
|
||||
test_expect_success 'revert a non-merge with -m should fail' '
|
||||
|
||||
git reset --hard &&
|
||||
git checkout c^0 &&
|
||||
! git revert -m 1 b &&
|
||||
git diff --exit-code c
|
||||
|
||||
'
|
||||
|
||||
test_expect_success 'revert a merge without -m should fail' '
|
||||
|
||||
git reset --hard &&
|
||||
git checkout c^0 &&
|
||||
! git revert c &&
|
||||
git diff --exit-code c
|
||||
|
||||
'
|
||||
|
||||
test_expect_success 'revert a merge (1)' '
|
||||
|
||||
git reset --hard &&
|
||||
git checkout c^0 &&
|
||||
git revert -m 1 c &&
|
||||
git diff --exit-code a --
|
||||
|
||||
'
|
||||
|
||||
test_expect_success 'revert a merge (2)' '
|
||||
|
||||
git reset --hard &&
|
||||
git checkout c^0 &&
|
||||
git revert -m 2 c &&
|
||||
git diff --exit-code b --
|
||||
|
||||
'
|
||||
|
||||
test_expect_success 'revert a merge relative to nonexistent parent should fail' '
|
||||
|
||||
git reset --hard &&
|
||||
git checkout c^0 &&
|
||||
! git revert -m 3 c &&
|
||||
git diff --exit-code c
|
||||
|
||||
'
|
||||
|
||||
test_done
|
42
t/t4021-format-patch-signer-mime.sh
Executable file
42
t/t4021-format-patch-signer-mime.sh
Executable file
@ -0,0 +1,42 @@
|
||||
#!/bin/sh
|
||||
|
||||
test_description='format-patch -s should force MIME encoding as needed'
|
||||
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success setup '
|
||||
|
||||
>F &&
|
||||
git add F &&
|
||||
git commit -m initial &&
|
||||
echo new line >F &&
|
||||
|
||||
test_tick &&
|
||||
git commit -m "This adds some lines to F" F
|
||||
|
||||
'
|
||||
|
||||
test_expect_success 'format normally' '
|
||||
|
||||
git format-patch --stdout -1 >output &&
|
||||
! grep Content-Type output
|
||||
|
||||
'
|
||||
|
||||
test_expect_success 'format with signoff without funny signer name' '
|
||||
|
||||
git format-patch -s --stdout -1 >output &&
|
||||
! grep Content-Type output
|
||||
|
||||
'
|
||||
|
||||
test_expect_success 'format with non ASCII signer name' '
|
||||
|
||||
GIT_COMMITTER_NAME="$B$O$^$N(B $B$U$K$*$&(B" \
|
||||
git format-patch -s --stdout -1 >output &&
|
||||
grep Content-Type output
|
||||
|
||||
'
|
||||
|
||||
test_done
|
||||
|
@ -1,3 +1,6 @@
|
||||
|
||||
|
||||
|
||||
From nobody Mon Sep 17 00:00:00 2001
|
||||
From: A U Thor <a.u.thor@example.com>
|
||||
Date: Fri, 9 Jun 2006 00:44:16 -0700
|
||||
|
@ -208,4 +208,11 @@ test_expect_success 'fetch with a non-applying branch.<name>.merge' '
|
||||
git fetch blub
|
||||
'
|
||||
|
||||
# the strange name is: a\!'b
|
||||
test_expect_success 'quoting of a strangely named repo' '
|
||||
! git fetch "a\\!'\''b" > result 2>&1 &&
|
||||
cat result &&
|
||||
grep "fatal: '\''a\\\\!'\''b'\''" result
|
||||
'
|
||||
|
||||
test_done
|
||||
|
@ -402,4 +402,11 @@ test_expect_success 'test resetting the index at give paths' '
|
||||
|
||||
'
|
||||
|
||||
test_expect_success 'resetting an unmodified path is a no-op' '
|
||||
git reset --hard &&
|
||||
git reset -- file1 &&
|
||||
git diff-files --exit-code &&
|
||||
git diff-index --cached --exit-code HEAD
|
||||
'
|
||||
|
||||
test_done
|
||||
|
@ -77,7 +77,7 @@ test_expect_success "checkout with dirty tree without -m" '
|
||||
test_expect_success "checkout -m with dirty tree" '
|
||||
|
||||
git checkout -f master &&
|
||||
git clean &&
|
||||
git clean -f &&
|
||||
|
||||
fill 0 1 2 3 4 5 6 7 8 >one &&
|
||||
git checkout -m side &&
|
||||
@ -99,7 +99,7 @@ test_expect_success "checkout -m with dirty tree" '
|
||||
|
||||
test_expect_success "checkout -m with dirty tree, renamed" '
|
||||
|
||||
git checkout -f master && git clean &&
|
||||
git checkout -f master && git clean -f &&
|
||||
|
||||
fill 1 2 3 4 5 7 8 >one &&
|
||||
if git checkout renamer
|
||||
@ -121,7 +121,7 @@ test_expect_success "checkout -m with dirty tree, renamed" '
|
||||
|
||||
test_expect_success 'checkout -m with merge conflict' '
|
||||
|
||||
git checkout -f master && git clean &&
|
||||
git checkout -f master && git clean -f &&
|
||||
|
||||
fill 1 T 3 4 5 6 S 8 >one &&
|
||||
if git checkout renamer
|
||||
@ -144,7 +144,7 @@ test_expect_success 'checkout -m with merge conflict' '
|
||||
|
||||
test_expect_success 'checkout to detach HEAD' '
|
||||
|
||||
git checkout -f renamer && git clean &&
|
||||
git checkout -f renamer && git clean -f &&
|
||||
git checkout renamer^ &&
|
||||
H=$(git rev-parse --verify HEAD) &&
|
||||
M=$(git show-ref -s --verify refs/heads/master) &&
|
||||
@ -160,7 +160,7 @@ test_expect_success 'checkout to detach HEAD' '
|
||||
|
||||
test_expect_success 'checkout to detach HEAD with branchname^' '
|
||||
|
||||
git checkout -f master && git clean &&
|
||||
git checkout -f master && git clean -f &&
|
||||
git checkout renamer^ &&
|
||||
H=$(git rev-parse --verify HEAD) &&
|
||||
M=$(git show-ref -s --verify refs/heads/master) &&
|
||||
@ -176,7 +176,7 @@ test_expect_success 'checkout to detach HEAD with branchname^' '
|
||||
|
||||
test_expect_success 'checkout to detach HEAD with HEAD^0' '
|
||||
|
||||
git checkout -f master && git clean &&
|
||||
git checkout -f master && git clean -f &&
|
||||
git checkout HEAD^0 &&
|
||||
H=$(git rev-parse --verify HEAD) &&
|
||||
M=$(git show-ref -s --verify refs/heads/master) &&
|
||||
|
114
t/t7300-clean.sh
114
t/t7300-clean.sh
@ -7,6 +7,8 @@ test_description='git-clean basic tests'
|
||||
|
||||
. ./test-lib.sh
|
||||
|
||||
git config clean.requireForce no
|
||||
|
||||
test_expect_success 'setup' '
|
||||
|
||||
mkdir -p src &&
|
||||
@ -37,6 +39,93 @@ test_expect_success 'git-clean' '
|
||||
|
||||
'
|
||||
|
||||
test_expect_success 'git-clean src/' '
|
||||
|
||||
mkdir -p build docs &&
|
||||
touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
|
||||
git-clean src/ &&
|
||||
test -f Makefile &&
|
||||
test -f README &&
|
||||
test -f src/part1.c &&
|
||||
test -f src/part2.c &&
|
||||
test -f a.out &&
|
||||
test ! -f src/part3.c &&
|
||||
test -f docs/manual.txt &&
|
||||
test -f obj.o &&
|
||||
test -f build/lib.so
|
||||
|
||||
'
|
||||
|
||||
test_expect_success 'git-clean src/ src/' '
|
||||
|
||||
mkdir -p build docs &&
|
||||
touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
|
||||
git-clean src/ src/ &&
|
||||
test -f Makefile &&
|
||||
test -f README &&
|
||||
test -f src/part1.c &&
|
||||
test -f src/part2.c &&
|
||||
test -f a.out &&
|
||||
test ! -f src/part3.c &&
|
||||
test -f docs/manual.txt &&
|
||||
test -f obj.o &&
|
||||
test -f build/lib.so
|
||||
|
||||
'
|
||||
|
||||
test_expect_success 'git-clean with prefix' '
|
||||
|
||||
mkdir -p build docs &&
|
||||
touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
|
||||
(cd src/ && git-clean) &&
|
||||
test -f Makefile &&
|
||||
test -f README &&
|
||||
test -f src/part1.c &&
|
||||
test -f src/part2.c &&
|
||||
test -f a.out &&
|
||||
test ! -f src/part3.c &&
|
||||
test -f docs/manual.txt &&
|
||||
test -f obj.o &&
|
||||
test -f build/lib.so
|
||||
|
||||
'
|
||||
test_expect_success 'git-clean -d with prefix and path' '
|
||||
|
||||
mkdir -p build docs src/feature &&
|
||||
touch a.out src/part3.c src/feature/file.c docs/manual.txt obj.o build/lib.so &&
|
||||
(cd src/ && git-clean -d feature/) &&
|
||||
test -f Makefile &&
|
||||
test -f README &&
|
||||
test -f src/part1.c &&
|
||||
test -f src/part2.c &&
|
||||
test -f a.out &&
|
||||
test -f src/part3.c &&
|
||||
test ! -f src/feature/file.c &&
|
||||
test -f docs/manual.txt &&
|
||||
test -f obj.o &&
|
||||
test -f build/lib.so
|
||||
|
||||
'
|
||||
|
||||
test_expect_success 'git-clean symbolic link' '
|
||||
|
||||
mkdir -p build docs &&
|
||||
touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
|
||||
ln -s docs/manual.txt src/part4.c
|
||||
git-clean &&
|
||||
test -f Makefile &&
|
||||
test -f README &&
|
||||
test -f src/part1.c &&
|
||||
test -f src/part2.c &&
|
||||
test ! -f a.out &&
|
||||
test ! -f src/part3.c &&
|
||||
test ! -f src/part4.c &&
|
||||
test -f docs/manual.txt &&
|
||||
test -f obj.o &&
|
||||
test -f build/lib.so
|
||||
|
||||
'
|
||||
|
||||
test_expect_success 'git-clean -n' '
|
||||
|
||||
mkdir -p build docs &&
|
||||
@ -71,6 +160,24 @@ test_expect_success 'git-clean -d' '
|
||||
|
||||
'
|
||||
|
||||
test_expect_success 'git-clean -d src/ examples/' '
|
||||
|
||||
mkdir -p build docs examples &&
|
||||
touch a.out src/part3.c docs/manual.txt obj.o build/lib.so examples/1.c &&
|
||||
git-clean -d src/ examples/ &&
|
||||
test -f Makefile &&
|
||||
test -f README &&
|
||||
test -f src/part1.c &&
|
||||
test -f src/part2.c &&
|
||||
test -f a.out &&
|
||||
test ! -f src/part3.c &&
|
||||
test ! -f examples/1.c &&
|
||||
test -f docs/manual.txt &&
|
||||
test -f obj.o &&
|
||||
test -f build/lib.so
|
||||
|
||||
'
|
||||
|
||||
test_expect_success 'git-clean -x' '
|
||||
|
||||
mkdir -p build docs &&
|
||||
@ -139,6 +246,13 @@ test_expect_success 'git-clean -d -X' '
|
||||
|
||||
'
|
||||
|
||||
test_expect_success 'clean.requireForce defaults to true' '
|
||||
|
||||
git config --unset clean.requireForce &&
|
||||
! git-clean
|
||||
|
||||
'
|
||||
|
||||
test_expect_success 'clean.requireForce' '
|
||||
|
||||
git config clean.requireForce true &&
|
||||
|
56
t/t9106-git-svn-dcommit-clobber-series.sh
Executable file
56
t/t9106-git-svn-dcommit-clobber-series.sh
Executable file
@ -0,0 +1,56 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2007 Eric Wong
|
||||
test_description='git-svn dcommit clobber series'
|
||||
. ./lib-git-svn.sh
|
||||
|
||||
test_expect_success 'initialize repo' "
|
||||
mkdir import &&
|
||||
cd import &&
|
||||
awk 'BEGIN { for (i = 1; i < 64; i++) { print i } }' > file
|
||||
svn import -m 'initial' . $svnrepo &&
|
||||
cd .. &&
|
||||
git svn init $svnrepo &&
|
||||
git svn fetch &&
|
||||
test -e file
|
||||
"
|
||||
|
||||
test_expect_success '(supposedly) non-conflicting change from SVN' "
|
||||
test x\"\`sed -n -e 58p < file\`\" = x58 &&
|
||||
test x\"\`sed -n -e 61p < file\`\" = x61 &&
|
||||
svn co $svnrepo tmp &&
|
||||
cd tmp &&
|
||||
perl -i -p -e 's/^58\$/5588/' file &&
|
||||
perl -i -p -e 's/^61\$/6611/' file &&
|
||||
test x\"\`sed -n -e 58p < file\`\" = x5588 &&
|
||||
test x\"\`sed -n -e 61p < file\`\" = x6611 &&
|
||||
svn commit -m '58 => 5588, 61 => 6611' &&
|
||||
cd ..
|
||||
"
|
||||
|
||||
test_expect_success 'some unrelated changes to git' "
|
||||
echo hi > life &&
|
||||
git update-index --add life &&
|
||||
git commit -m hi-life &&
|
||||
echo bye >> life &&
|
||||
git commit -m bye-life life
|
||||
"
|
||||
|
||||
test_expect_success 'change file but in unrelated area' "
|
||||
test x\"\`sed -n -e 4p < file\`\" = x4 &&
|
||||
test x\"\`sed -n -e 7p < file\`\" = x7 &&
|
||||
perl -i -p -e 's/^4\$/4444/' file &&
|
||||
perl -i -p -e 's/^7\$/7777/' file &&
|
||||
test x\"\`sed -n -e 4p < file\`\" = x4444 &&
|
||||
test x\"\`sed -n -e 7p < file\`\" = x7777 &&
|
||||
git commit -m '4 => 4444, 7 => 7777' file &&
|
||||
git svn dcommit &&
|
||||
svn up tmp &&
|
||||
cd tmp &&
|
||||
test x\"\`sed -n -e 4p < file\`\" = x4444 &&
|
||||
test x\"\`sed -n -e 7p < file\`\" = x7777 &&
|
||||
test x\"\`sed -n -e 58p < file\`\" = x5588 &&
|
||||
test x\"\`sed -n -e 61p < file\`\" = x6611
|
||||
"
|
||||
|
||||
test_done
|
@ -86,4 +86,9 @@ test_expect_success 'verify post-merge ancestry' "
|
||||
git cat-file commit refs/heads/svn^ | grep '^friend$'
|
||||
"
|
||||
|
||||
test_expect_success 'verify merge commit message' "
|
||||
git rev-list --pretty=raw -1 refs/heads/svn | \
|
||||
grep \" Merge branch 'merge' into svn\"
|
||||
"
|
||||
|
||||
test_done
|
||||
|
@ -31,7 +31,6 @@ our \$projects_list = "";
|
||||
our \$export_ok = "";
|
||||
our \$strict_export = "";
|
||||
|
||||
CGI::Carp::set_programname("gitweb/gitweb.cgi");
|
||||
EOF
|
||||
|
||||
cat >.git/description <<EOF
|
||||
@ -558,4 +557,27 @@ test_expect_success \
|
||||
'gitweb_run "p=.git;a=tree;opt=--no-merges"'
|
||||
test_debug 'cat gitweb.log'
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# gitweb config and repo config
|
||||
|
||||
cat >>gitweb_config.perl <<EOF
|
||||
|
||||
\$feature{'blame'}{'override'} = 1;
|
||||
\$feature{'snapshot'}{'override'} = 1;
|
||||
EOF
|
||||
|
||||
test_expect_success \
|
||||
'config override: tree view, features disabled in repo config' \
|
||||
'git config gitweb.blame no &&
|
||||
git config gitweb.snapshot none &&
|
||||
gitweb_run "p=.git;a=tree"'
|
||||
test_debug 'cat gitweb.log'
|
||||
|
||||
test_expect_success \
|
||||
'config override: tree view, features enabled in repo config' \
|
||||
'git config gitweb.blame yes &&
|
||||
git config gitweb.snapshot "zip,tgz, tbz2" &&
|
||||
gitweb_run "p=.git;a=tree"'
|
||||
test_debug 'cat gitweb.log'
|
||||
|
||||
test_done
|
||||
|
Reference in New Issue
Block a user