X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=inline;f=t%2Ft7001-mv.sh;h=fa382c58da08a6eeca1aa51d4af47215e3e1c107;hb=b4a299d87ca7a1d39c699ee2af28305e57f3b0ae;hp=b1243b4163d231bb0f29fd91fe7fa15c34463c82;hpb=413b90f0da613b4edeb6259e04c7dc36b703bc3b;p=git.git diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index b1243b416..fa382c58d 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -118,4 +118,42 @@ test_expect_success "Sergey Vlasov's test case" ' git mv ab a ' +test_expect_success 'absolute pathname' '( + + rm -fr mine && + mkdir mine && + cd mine && + test_create_repo one && + cd one && + mkdir sub && + >sub/file && + git add sub/file && + + git mv sub "$(pwd)/in" && + ! test -d sub && + test -d in && + git ls-files --error-unmatch in/file + + +)' + +test_expect_success 'absolute pathname outside should fail' '( + + rm -fr mine && + mkdir mine && + cd mine && + out=$(pwd) && + test_create_repo one && + cd one && + mkdir sub && + >sub/file && + git add sub/file && + + ! git mv sub "$out/out" && + test -d sub && + ! test -d ../in && + git ls-files --error-unmatch sub/file + +)' + test_done