Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 347852

Summary: Cloning should fail when destination directory exists and is not empty
Product: [Technology] JGit Reporter: Tomasz Zarna <tomasz.zarna>
Component: JGitAssignee: Adrian Goerler <adrian.goerler>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: matthias.sohn
Version: 1.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
URL: http://egit.eclipse.org/r/#change,3518
Whiteboard:
Attachments:
Description Flags
Screen shot indicating that non-empty traget directory is rejected none

Description Tomasz Zarna CLA 2011-05-31 15:25:06 EDT
Copied from http://egit.eclipse.org/r/#change,3518:

In msysgit, when I try to clone into a folder that already
contains a cloned repository it will fail with a message "fatal:
destination path 'folder' already exists and is not an empty
directory.". I would expect JGit to throw an exception with a similar
message in that case.
Comment 1 Adrian Goerler CLA 2011-07-04 02:52:08 EDT
Created attachment 199027 [details]
Screen shot indicating that non-empty traget directory is rejected
Comment 2 Adrian Goerler CLA 2011-07-04 03:20:49 EDT
A non-empty target directory seems to be rejected in EGit on ui-level (see https://bugs.eclipse.org/bugs/attachment.cgi?id=199027).

Still there should be an additional check in JGit on command-level.
Comment 3 Matthias Sohn CLA 2011-07-06 17:17:21 EDT
merged as 172a9f05216394f243805844b446cc357dd6b943