Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2007-12-11 15:53:47 +0300
committerJunio C Hamano <gitster@pobox.com>2007-12-11 22:07:23 +0300
commitef4cffde9cf45a4203be5f78cf8f025f4f694a66 (patch)
tree2a3c491803f88015dfbeadfbc9af619d75d3e0df /git-clone.sh
parent18ff365fcb3b16d6802c04da03ceda3a260c0ab9 (diff)
git-clone: print an error message when trying to clone empty repo
Previously, cloning an empty repository looked like this: $ (mkdir parent && cd parent && git --bare init) $ git-clone parent child Initialized empty Git repository in /home/peff/clone/child/.git/ $ cd child -bash: cd: child: No such file or directory $ echo 'wtf?' | mail git@vger.kernel.org Now we at least report that the clone was not successful. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-clone.sh')
-rwxr-xr-xgit-clone.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/git-clone.sh b/git-clone.sh
index ecf9d89a10..96a356d8b3 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -297,7 +297,8 @@ yes)
find objects -type f -print | sed -e 1q)
# objects directory should not be empty because
# we are cloning!
- test -f "$repo/$sample_file" || exit
+ test -f "$repo/$sample_file" ||
+ die "fatal: cannot clone empty repository"
if ln "$repo/$sample_file" "$GIT_DIR/objects/sample" 2>/dev/null
then
rm -f "$GIT_DIR/objects/sample"