Bug 20098

Summary: cloning into an exsting dir is actually allowed
Product: Sisyphus Reporter: Ivan Zakharyaschev <imz>
Component: git-coreAssignee: placeholder <placeholder>
Status: CLOSED FIXED QA Contact: qa-sisyphus
Severity: minor    
Priority: P3 CC: glebfm, ldv, placeholder
Version: unstable   
Hardware: all   
OS: Linux   

Description Ivan Zakharyaschev 2009-05-19 04:33:55 MSD
git-core-1.6.2.4-alt1

"man git-clone" says:

       <directory>
 ...
          Cloning into an existing directory is not allowed.

but in practice git doesn't conform to this:

[ivan@dell git]$ mkdir repo
[ivan@dell git]$ cd repo
[ivan@dell repo]$ git init
Initialized empty Git repository in /space/ivan/OUT/bugreports/ALT/git/repo/.git/
[ivan@dell repo]$ echo a > a
[ivan@dell repo]$ git add a
[ivan@dell repo]$ git commit -m 'Initial.'
[master (root-commit) 52dfade] Initial.
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 a
[ivan@dell repo]$ mkdir ../existing
[ivan@dell repo]$ git clone . ../existing/
Initialized empty Git repository in /space/ivan/OUT/bugreports/ALT/git/existing/.git/
[ivan@dell repo]$ cd ../existing/
[ivan@dell existing]$ git status
# On branch master
nothing to commit (working directory clean)
[ivan@dell existing]$
Comment 1 Ivan Zakharyaschev 2009-05-20 01:40:31 MSD
Contrastingly, git-core-1.5.5.5-alt1 from 4.1 adheres to the documentation.
Comment 2 Dmitry V. Levin 2009-06-05 01:58:24 MSD
Cloning into an existing empty directory is allowed since v1.6.2 (commit 55892d23981917aefdb387ad7d0429f90cbd446a),
this change was documented in v1.6.3.1 (commit ec00d6e0038e030cf73182374e21025c2776cb23).
Comment 3 Dmitry V. Levin 2018-08-03 01:56:55 MSK
Let's say it's fixed.