Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 362788 - Cloning a repo to existing project cleans this project contents
Summary: Cloning a repo to existing project cleans this project contents
Status: RESOLVED WONTFIX
Alias: None
Product: Orion
Classification: ECD
Component: Git (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-03 08:57 EDT by Malgorzata Janczarska CLA
Modified: 2015-05-05 14:46 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Malgorzata Janczarska CLA 2011-11-03 08:57:02 EDT
1. Clone a repository to an existing directory
2. Verify that repository contents is placed in the directory
3. Clone another repository to the same directory as in point 1.
4. Cloning ends with an error (error 500 while running operation: Destination path "ar" already exists and is not an empty directory) [GOOD]
5. The target directory is now empty, all its contents has been removed [BAD]

I think the contents of the directory shound't be removed when cloning fails. I think we should also think of a way to display a warning ("Add contents of directory [...] will be removed, do you want to continue?").
Comment 1 John J. Barton CLA 2011-11-03 09:45:33 EDT
I think the current clone-into-folder is just broken.  

If I am on unix command line in current directory foo/ and issue 
  git clone <url>
then a new subdir is created in foo/

When I issued clone on the orion page and selected folder 'testcases' I expected the clone to land in a subdir of testcases/. I did not expect testcases to be overwritten.

Rather than supporting over-write, it would be simpler for the use and orion to require that users delete existing directories if they want to overwrite them.
Comment 2 Malgorzata Janczarska CLA 2011-11-03 11:33:56 EDT
(In reply to comment #1)
So the problem is that you expected the repository to be cloned into a subfolder with a name same as a name of the repository?

Cloning repository without specifying any directory is an equivalent of "git clone <url>" command that clones repository to a subfolder of your current directory, which, in Orion, is your workspace.
Cloning repository to existing directory is equvalent to "git clone <url> <path>" that clones a repository to a given <path> without creating a subdirectory.
With current workflow you can clone a repository to a folder of a different name and if you want a subdirectory you can always create it. I've been using it for a while and I find it more convenient, but I also understand your point. I think what misses is a possibility to create a subfolder of a given name while cloning. I can see something like "create subfolder" checkbox on directory choosing dialog and a default name of the folder as a name of the repository.
Comment 3 John Arthorne CLA 2015-05-05 14:46:18 EDT
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see:

https://dev.eclipse.org/mhonarc/lists/orion-dev/msg03444.html