Git development
 help / color / mirror / Atom feed
From: exon@op5.se (Andreas Ericsson)
To: git@vger.kernel.org
Subject: [PATCH 2/2] git-clone: Allow cloning into directories other than child of current dir.
Date: Thu, 10 Nov 2005 12:58:08 +0100 (CET)	[thread overview]
Message-ID: <20051110115808.466765BB44@nox.op5.se> (raw)


This patch adds -p to mkdir and an explicit check to see if the target
directory exists (since mkdir -p doesn't throw an error if it does).

Signed-off-by: Andreas Ericsson <ae@op5.se>

---

 git-clone.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

applies-to: 28cfa6f299b27be02a24b6887f9b82b42c0e08cd
48b959195a979b113e51e898ac878a0fd7cfb30a
diff --git a/git-clone.sh b/git-clone.sh
index 70cf7a2..4b98fb1 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -98,7 +98,8 @@ fi
 dir="$2"
 # Try using "humanish" part of source repo if user didn't specify one
 [ -z "$dir" ] && dir=$(echo "$repo" | sed -e 's#/*\.git$##' -e 's#.*[/:]##')
-mkdir "$dir" &&
+[ -e "$dir" ] && $(echo "$dir already exists."; usage)
+mkdir -p "$dir" &&
 D=$(
 	(cd "$dir" && git-init-db && pwd)
 ) &&
---
0.99.9.GIT

                 reply	other threads:[~2005-11-10 11:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20051110115808.466765BB44@nox.op5.se \
    --to=exon@op5.se \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox