All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Wijen <ben@wijen.net>
To: git@vger.kernel.org
Cc: Ben Wijen <ben@wijen.net>
Subject: [PATCH 1/2] git clone: check for non-empty directory
Date: Wed,  1 Jul 2020 11:36:52 +0200	[thread overview]
Message-ID: <20200701093653.3706-2-ben@wijen.net> (raw)
In-Reply-To: <20200701093653.3706-1-ben@wijen.net>

When using git clone with --separate-git-dir realgitdir and
realgitdir already exists, it's content is destroyed.

Extend test to make sure content is left intact

Signed-off-by: Ben Wijen <ben@wijen.net>
---
 t/t5601-clone.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index 84ea2a3eb7..03901c55f2 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -271,7 +271,8 @@ test_expect_success 'fetch from gitfile parent' '
 
 test_expect_success 'clone separate gitdir where target already exists' '
 	rm -rf dst &&
-	test_must_fail git clone --separate-git-dir realgitdir src dst
+	test_must_fail git clone --separate-git-dir realgitdir src dst &&
+	test -f realgitdir/config
 '
 
 test_expect_success 'clone --reference from original' '
-- 
2.27.0


  reply	other threads:[~2020-07-01  9:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-01  9:36 [PATCH 0/2] git clone with --separate-git-dir destroys existing directory content Ben Wijen
2020-07-01  9:36 ` Ben Wijen [this message]
2020-07-01 16:00   ` [PATCH 1/2] git clone: check for non-empty directory Eric Sunshine
2020-07-01 17:40     ` Eric Sunshine
2020-07-02  5:32     ` Eric Sunshine
2020-07-01  9:36 ` [PATCH 2/2] git clone: don't clone into " Ben Wijen
2020-07-01 16:10   ` Eric Sunshine
2020-07-02  7:50     ` Ben
2020-07-01 15:39 ` [PATCH 0/2] git clone with --separate-git-dir destroys existing directory content Eric Sunshine
2020-07-02  8:13   ` [PATCH v2 0/1] git clone: don't clone into non-empty directory Ben Wijen
2020-07-02  8:13   ` [PATCH v2 1/1] " Ben Wijen
2020-07-06 22:40     ` Junio C Hamano
2020-07-10  8:47       ` [PATCH v3 0/1] " Ben Wijen
2020-07-10  8:47       ` [PATCH v3 1/1] " Ben Wijen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200701093653.3706-2-ben@wijen.net \
    --to=ben@wijen.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.