diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-04-01 17:57:37 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-04-01 17:57:37 -0700 |
commit | c4b2ce69534e1d51f71142ba0e463ed89605ccd1 (patch) | |
tree | 6cb1a1c828b387e14e2e39fc931892a609725527 /t/t0001-init.sh | |
parent | Merge branch 'jc/merge-sans-branch' (diff) | |
parent | init, clone: support --separate-git-dir for .git file (diff) | |
download | tgif-c4b2ce69534e1d51f71142ba0e463ed89605ccd1.tar.xz |
Merge branch 'nd/init-gitdir'
* nd/init-gitdir:
init, clone: support --separate-git-dir for .git file
git-init.txt: move description section up
Conflicts:
builtin/clone.c
Diffstat (limited to 't/t0001-init.sh')
-rwxr-xr-x | t/t0001-init.sh | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/t/t0001-init.sh b/t/t0001-init.sh index 0ee9f17993..a5816d0e4f 100755 --- a/t/t0001-init.sh +++ b/t/t0001-init.sh @@ -371,4 +371,50 @@ test_expect_success 'init prefers command line to GIT_DIR' ' ! test -d otherdir/refs ' +test_expect_success 'init with separate gitdir' ' + rm -rf newdir && + git init --separate-git-dir realgitdir newdir && + echo "gitdir: `pwd`/realgitdir" >expected && + test_cmp expected newdir/.git && + test -d realgitdir/refs +' + +test_expect_success 're-init to update git link' ' + ( + cd newdir && + git init --separate-git-dir ../surrealgitdir + ) && + echo "gitdir: `pwd`/surrealgitdir" >expected && + test_cmp expected newdir/.git && + test -d surrealgitdir/refs && + ! test -d realgitdir/refs +' + +test_expect_success 're-init to move gitdir' ' + rm -rf newdir realgitdir surrealgitdir && + git init newdir && + ( + cd newdir && + git init --separate-git-dir ../realgitdir + ) && + echo "gitdir: `pwd`/realgitdir" >expected && + test_cmp expected newdir/.git && + test -d realgitdir/refs +' + +test_expect_success 're-init to move gitdir symlink' ' + rm -rf newdir realgitdir && + git init newdir && + ( + cd newdir && + mv .git here && + ln -s here .git && + git init -L ../realgitdir + ) && + echo "gitdir: `pwd`/realgitdir" >expected && + test_cmp expected newdir/.git && + test -d realgitdir/refs && + ! test -d newdir/here +' + test_done |