diff options
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | 2008-08-02 23:38:56 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-08-03 02:21:59 +0400 |
commit | bc699afcce3c45bb17aaca145d081992ed699a42 (patch) | |
tree | e52a0b9ceb2aca3543bfab40dde0f0a1398fe41e /t | |
parent | 372c767610c4e4d7f4832d037ac51a62a59875a3 (diff) |
clone: Add an option to set up a mirror
The command line
$ git clone --mirror $URL
is now a short-hand for
$ git clone --bare $URL
$ (cd $(basename $URL) && git remote add --mirror origin $URL)
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t5601-clone.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh index d785b3df78..a5334570ad 100755 --- a/t/t5601-clone.sh +++ b/t/t5601-clone.sh @@ -70,4 +70,16 @@ test_expect_success 'clone creates intermediate directories for bare repo' ' ' +test_expect_success 'clone --mirror' ' + + git clone --mirror src mirror && + test -f mirror/HEAD && + test ! -f mirror/file && + FETCH="$(cd mirror && git config remote.origin.fetch)" && + test "+refs/*:refs/*" = "$FETCH" && + MIRROR="$(cd mirror && git config --bool remote.origin.mirror)" && + test "$MIRROR" = true + +' + test_done |