Bug 6485 - MonoDevelop exception on adding files with git repository on Windows share
Summary: MonoDevelop exception on adding files with git repository on Windows share
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Version Control ()
Version: unspecified
Hardware: PC Windows
: Low normal
Target Milestone: master
Assignee: Marius Ungureanu
Depends on:
Reported: 2012-08-09 02:56 UTC by Michael Fink
Modified: 2015-08-20 03:23 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Michael Fink 2012-08-09 02:56:42 UTC
I'm using MonoDevelop with MonoDroid On several actions having to do with adding files to a MonoDroid project, I get an exception about XXXXXXXXXXXX. The project I open is stored in a local git repository, which has a remote repository that is stored on a Windows share; the URL is something like: "\\\\\\\\computername\\git". I use GitExtensions to manage the repository, and the URL had to be entered that way in the UI. git operations on the command line work, too.

Steps to reproduce:
1. Open a project stored in a git repository that has a remote repository stored on a Windows share.
2. Right-click on the project and choose to add a new file ("Add > New file..." or "Hinzufügen > Neue Datei..." in my version).
3. Choose any file type, e.g. Android Class, enter a name and click on "New".
4. An error message box appears with the next "Ein Fehler hat sich ereignet" (translated "an error has occured") and the second line "\\\\computername\git Cannot parse Git URI-ish". Exception call stack see below.
5. I repeat step 2 and 3
6. No exception occurs, but the project file tree isn't updated.
7. When I close the solution and open it again, the file has been added.

It's the same when adding existing files, or when adding multiple files or files in a folder.

Exception call stack:

Sharpen.URISyntaxException: \\\\computername\git Cannot parse Git URI-ish
   bei NGit.Transport.URIish..ctor(String s)
   bei NGit.Transport.RemoteConfig..ctor(Config rc, String remoteName)
   bei NGit.Transport.RemoteConfig.GetAllRemoteConfigs(Config rc)
   bei MonoDevelop.VersionControl.Git.GitRepository.<GetRemotes>d__15.MoveNext()
   bei System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   bei System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   bei MonoDevelop.VersionControl.Git.GitRepository.GetCurrentRemote()
   bei MonoDevelop.VersionControl.Git.GitRepository.GetSupportedOperations(VersionInfo vinfo)
   bei MonoDevelop.VersionControl.VersionInfo.get_AllowedOperations()
   bei MonoDevelop.VersionControl.VersionInfo.SupportsOperation(VersionControlOperation op)
   bei MonoDevelop.VersionControl.VersionInfo.get_CanAdd()
   bei MonoDevelop.VersionControl.VersionControlService.<OnFileAdded>b__f(VersionInfo i)
   bei System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   bei System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   bei System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   bei MonoDevelop.VersionControl.VersionControlService.OnFileAdded(Object s, ProjectFileEventArgs e)
   bei MonoDevelop.Projects.ProjectFileEventHandler.Invoke(Object sender, ProjectFileEventArgs e)
   bei MonoDevelop.Ide.RootWorkspace.NotifyFileAddedToProject(Object sender, ProjectFileEventArgs e)
   bei __ProjectFileEventHandler_DelegateFactory_3.Dispatch(Object )
   bei MonoDevelop.Ide.Gui.GuiSyncContext.AsyncDispatch(StatefulMessageHandler cb, Object ob)
   bei __ProjectFileEventHandler_DelegateFactory_3.ProxyCall(Object , ProjectFileEventArgs )
   bei MonoDevelop.Projects.Solution.OnFileAddedToProject(ProjectFileEventArgs args)
   bei MonoDevelop.Projects.SolutionFolder.OnFileAddedToProject(ProjectFileEventArgs e)
   bei MonoDevelop.Projects.SolutionFolder.NotifyFileAddedToProject(Object sender, ProjectFileEventArgs e)
   bei MonoDevelop.Projects.ProjectFileEventHandler.Invoke(Object sender, ProjectFileEventArgs e)
   bei MonoDevelop.Projects.Project.OnFileAddedToProject(ProjectFileEventArgs e)
   bei MonoDevelop.MonoDroid.MonoDroidProject.OnFileAddedToProject(ProjectFileEventArgs args)
   bei MonoDevelop.Projects.Project.NotifyFileAddedToProject(IEnumerable`1 objs)
   bei MonoDevelop.Projects.Project.OnItemsAdded(IEnumerable`1 objs)
   bei MonoDevelop.Projects.DotNetProject.OnItemsAdded(IEnumerable`1 objs)
   bei MonoDevelop.Projects.ProjectItemCollection`1.NotifyAdded(IEnumerable`1 items, Boolean comesFromParent)
   bei MonoDevelop.Projects.ProjectItemCollection`1.MonoDevelop.Projects.IItemListHandler.InternalAdd(IEnumerable`1 objs, Boolean comesFromParent)
   bei MonoDevelop.Projects.ProjectItemCollection`1.NotifyAdded(IEnumerable`1 items, Boolean comesFromParent)
   bei MonoDevelop.Projects.ProjectItemCollection`1.OnItemAdded(T item)
   bei MonoDevelop.Projects.ItemCollection`1.InsertItem(Int32 index, T item)
   bei System.Collections.ObjectModel.Collection`1.Add(T item)
   bei MonoDevelop.Projects.Project.AddFile(String filename, String buildAction)
   bei MonoDevelop.Ide.Templates.SingleFileDescriptionTemplate.AddFileToProject(SolutionItem policyParent, Project project, String language, String directory, String name)
   bei MonoDevelop.Ide.Templates.SingleFileDescriptionTemplate.AddToProject(SolutionItem policyParent, Project project, String language, String directory, String name)
   bei MonoDevelop.Ide.Templates.FileTemplate.CreateFile(FileDescriptionTemplate newfile, SolutionItem policyParent, Project project, String directory, String language, String name)
   bei MonoDevelop.Ide.Templates.FileTemplate.Create(SolutionItem policyParent, Project project, String directory, String language, String name)
   bei MonoDevelop.Ide.Projects.NewFileDialog.OpenEvent(Object sender, EventArgs e)
Comment 1 Alan McGovern 2012-11-22 06:41:48 UTC
There have been a few fixes in this area by the upstream JGit project. Would you be able to re-test this scenario to see if it's working now? I'm trying to get a similar setup created locally but it could take me a little while.
Comment 2 Michael Fink 2012-11-22 07:13:19 UTC
I just tested with MonoDevelop 3.0.5 (and Mono for Android 4.2.7) and the same error happens, with same stack trace.
Comment 3 Alan McGovern 2012-11-22 10:55:01 UTC
Can you describe how to set up a git repository which is cloneable via a windows share path? I can't make commandline git clone a repository directly from a windows share.
Comment 4 Michael Fink 2012-11-22 11:24:39 UTC
On the remote machine I created a git repository on a local path (using Git Extensions). I share the folder containing the ".git" folder on the remote machine so that it is visible to my local machine. On my local machine I clone the repository (using Git Extensions) using the following path:
In Git Extensions I had to double the first two slashes to four, the second slash didn't need doubling for some reason.
In the cloned repository (that contains a MonoDevelop project) I use a .sln file to work on my project. Then the error happens when adding a file (as described in the original bug description).
Comment 5 Marius Ungureanu 2014-10-07 03:52:06 UTC
Can this be verified in the libgit2sharp port?
Comment 6 Marius Ungureanu 2014-12-08 18:09:39 UTC
Marking as fixed for that milestone.
Comment 7 Abhishek 2015-05-05 13:16:50 UTC
@Marius, I have tried but not sure how to reproduce this issue at my end.

Steps I Followed:
1.Checkout an already published repository.
2.Right click on solution project.Go to Add->New File.
3.Newly File added to the solution.

Please let me know what next step I have to followed to reproduce and verify this issue at my end.

Comment 8 Marius Ungureanu 2015-05-05 13:47:37 UTC
You need to setup a Windows Share network drive and work with a repository cloned on that drive.
Comment 9 Abhishek 2015-05-06 11:28:24 UTC
Thanks @Marius,

Steps I followed:
1.Create a git clone repository on remote machine .
2.Open project on local machine through window Share network drive .
3.Right click on solution project.Go to Add->New File.
4.Newly File added to the solution.

Its working fine now. Could you please review my steps and let me know if I have to check something else?