Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 337055 - Cannot clone repo to path with "\Users\<user_name>\Desktop\*" path
Summary: Cannot clone repo to path with "\Users\<user_name>\Desktop\*" path
Status: CLOSED NOT_ECLIPSE
Alias: None
Product: EGit
Classification: Technology
Component: Core (show other bugs)
Version: 0.11   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-02-13 07:39 EST by CLA
Modified: 2011-02-21 09:46 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description CLA 2011-02-13 07:39:18 EST
On Windows 7:

Choose "Clone a Git Repository and add the clone to this view" from the Git Repositories View.

In the third wizard page for "Destination Directory" select a path to your Desktop such as "C:\Users\<user_name>\Desktop\Test".

The error message in the wizard is "Cannot create directory C:\Users\<user_name>\Desktop\Test."

The error message appears whether the "Test" folder exists or not.
Comment 1 CLA 2011-02-18 04:11:24 EST
Odd.

This is now working OK for me on eGit 0.12.0.201102120946.
Comment 2 CLA 2011-02-18 06:21:57 EST
(In reply to comment #1)
> Odd.
> 
> This is now working OK for me on eGit 0.12.0.201102120946.

Well...it's working now on one Windows box but not on another. The check is in class:

org.eclipse.egit.ui.internal.clone.CloneDestinationPage

method:

	private static boolean canCreateSubdir(final File parent) {
		if (parent == null)
			return true;
		if (parent.exists())
			return parent.isDirectory() && parent.canWrite();
		return canCreateSubdir(parent.getParentFile());
	}

parent.canWrite() returns false for "C:\Users\MyName\Desktop"
Comment 3 CLA 2011-02-18 06:32:52 EST
I think this is a Java bug on Windows, apparently fixed in Java 7:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4939819

Workaround is:

attrib -r "c:\Users\<user_name>\Desktop"

I guess we should close this bug.
Comment 4 CLA 2011-02-18 06:59:56 EST
Actually the Java bug is fixed in Java 6u23 http://www.oracle.com/technetwork/java/javase/2col/6u23bugfixes-191074.html

The Windows machine that I originally tested on was using Java 6u22. That's why I encountered the issue. I updated to Java u24 last night. That's why it started to be OK.

So, folks the moral of the story is - get the latest Java.

Close this bug maybe? But useful if someone else gets stung by it.