summaryrefslogtreecommitdiff
path: root/t/t5601-clone.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t5601-clone.sh')
-rwxr-xr-xt/t5601-clone.sh25
1 files changed, 24 insertions, 1 deletions
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index 9b34f3c..669ec9b 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -65,6 +65,29 @@ test_expect_success 'clone respects GIT_WORK_TREE' '
'
+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 &&
@@ -221,7 +244,7 @@ test_expect_success 'clone separate gitdir' '
'
test_expect_success 'clone separate gitdir: output' '
- echo "gitdir: `pwd`/realgitdir" >expected &&
+ echo "gitdir: $(pwd)/realgitdir" >expected &&
test_cmp expected dst/.git
'