From: Junio C Hamano Date: Tue, 17 May 2016 21:38:29 +0000 (-0700) Subject: Merge branch 'tb/t5601-sed-fix' X-Git-Tag: v2.9.0-rc0~29 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/a736214df3670ac3404b1ba8a4b6759391e75062?ds=inline;hp=-c Merge branch 'tb/t5601-sed-fix' Test fix. * tb/t5601-sed-fix: t5601: Remove trailing space in sed expression --- a736214df3670ac3404b1ba8a4b6759391e75062 diff --combined t/t5601-clone.sh index 150aeaf713,cb5ad72efa..a433394200 --- a/t/t5601-clone.sh +++ b/t/t5601-clone.sh @@@ -4,9 -4,6 +4,9 @@@ test_description=clon . ./test-lib.sh +X= +test_have_prereq !MINGW || X=.exe + test_expect_success setup ' rm -fr .git && @@@ -68,29 -65,6 +68,29 @@@ test_expect_success 'clone respects GIT ' +test_expect_success 'clone from hooks' ' + + test_create_repo r0 && + cd r0 && + test_commit initial && + cd .. && + git init r1 && + cd r1 && + cat >.git/hooks/pre-commit <<-\EOF && + #!/bin/sh + git clone ../r0 ../r2 + exit 1 + EOF + chmod u+x .git/hooks/pre-commit && + : >file && + git add file && + test_must_fail git commit -m invoke-hook && + cd .. && + test_cmp r0/.git/HEAD r2/.git/HEAD && + test_cmp r0/initial.t r2/initial.t + +' + test_expect_success 'clone creates intermediate directories' ' git clone src long/path/to/dst && @@@ -247,7 -221,7 +247,7 @@@ test_expect_success 'clone separate git ' test_expect_success 'clone separate gitdir: output' ' - echo "gitdir: `pwd`/realgitdir" >expected && + echo "gitdir: $(pwd)/realgitdir" >expected && test_cmp expected dst/.git ' @@@ -308,9 -282,14 +308,9 @@@ test_expect_success 'clone checking ou setup_ssh_wrapper () { test_expect_success 'setup ssh wrapper' ' - write_script "$TRASH_DIRECTORY/ssh-wrapper" <<-\EOF && - echo >>"$TRASH_DIRECTORY/ssh-output" "ssh: $*" && - # throw away all but the last argument, which should be the - # command - while test $# -gt 1; do shift; done - eval "$1" - EOF - GIT_SSH="$TRASH_DIRECTORY/ssh-wrapper" && + cp "$GIT_BUILD_DIR/t/helper/test-fake-ssh$X" \ + "$TRASH_DIRECTORY/ssh-wrapper$X" && + GIT_SSH="$TRASH_DIRECTORY/ssh-wrapper$X" && export GIT_SSH && export TRASH_DIRECTORY && >"$TRASH_DIRECTORY"/ssh-output @@@ -318,8 -297,8 +318,8 @@@ } copy_ssh_wrapper_as () { - cp "$TRASH_DIRECTORY/ssh-wrapper" "$1" && - GIT_SSH="$1" && + cp "$TRASH_DIRECTORY/ssh-wrapper$X" "${1%$X}$X" && + GIT_SSH="${1%$X}$X" && export GIT_SSH } @@@ -466,7 -445,7 +466,7 @@@ test_expect_success 'clone ssh://host.x #IPv6 for tuah in ::1 [::1] [::1]: user@::1 user@[::1] user@[::1]: [user@::1] [user@::1]: do - ehost=$(echo $tuah | sed -e "s/1]:/1]/ "| tr -d "[]") + ehost=$(echo $tuah | sed -e "s/1]:/1]/" | tr -d "[]") test_expect_success "clone ssh://$tuah/home/user/repo" " test_clone_url ssh://$tuah/home/user/repo $ehost /home/user/repo " @@@ -517,11 -496,4 +517,11 @@@ test_expect_success 'shallow clone loca ( cd ddsstt && git fsck ) ' +test_expect_success 'GIT_TRACE_PACKFILE produces a usable pack' ' + rm -rf dst.git && + GIT_TRACE_PACKFILE=$PWD/tmp.pack git clone --no-local --bare src dst.git && + git init --bare replay.git && + git -C replay.git index-pack -v --stdin