Bug 11478 - Invalid wildcards in git ref
Summary: Invalid wildcards in git ref
Status: VERIFIED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Version Control ()
Version: unspecified
Hardware: PC Mac OS
: Normal normal
Target Milestone: master
Assignee: Marius Ungureanu
URL:
: 13760 20401 ()
Depends on:
Blocks:
 
Reported: 2013-03-29 15:53 UTC by Mikayla Hutchinson [MSFT]
Modified: 2015-08-20 03:23 UTC (History)
7 users (show)

Tags:
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:
Status:
VERIFIED FIXED

Description Mikayla Hutchinson [MSFT] 2013-03-29 15:53:31 UTC
I manually added a ref to my git config file. It's valid, but ngit doesn't like it.

System.ArgumentException: Invalid wildcards +refs/pull/*/head:refs/remotes/origin/pr/*
  at NGit.Transport.RefSpec..ctor (System.String spec) [0x0014b] in /Users/michael/Mono/monodevelop/main/external/ngit/NGit/NGit.Transport/RefSpec.cs:177 
  at NGit.Transport.RemoteConfig..ctor (NGit.Config rc, System.String remoteName) [0x00132] in /Users/michael/Mono/monodevelop/main/external/ngit/NGit/NGit.Transport/RemoteConfig.cs:199 
  at NGit.Transport.RemoteConfig.GetAllRemoteConfigs (NGit.Config rc) [0x00039] in /Users/michael/Mono/monodevelop/main/external/ngit/NGit/NGit.Transport/RemoteConfig.cs:132 
  at MonoDevelop.VersionControl.Git.GitRepository+<GetRemotes>c__Iterator1.MoveNext () [0x0003b] in /Users/michael/Mono/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs:1086 
  at System.Linq.Enumerable+<CreateSelectIterator>c__Iterator25`2[MonoDevelop.VersionControl.Git.RemoteSource,System.String].MoveNext () [0x00059] in /private/tmp/source/bockbuild/profiles/mono-mac-release/build-root/mono-3.0.7/_build/mono-3.0.7.git/mcs/class/System.Core/System.Linq/Enumerable.cs:2269 
  at System.Collections.Generic.List`1[System.String].AddEnumerable (IEnumerable`1 enumerable) [0x00013] in /private/tmp/source/bockbuild/profiles/mono-mac-release/build-root/mono-3.0.7/_build/mono-3.0.7.git/mcs/class/corlib/System.Collections.Generic/List.cs:134 
  at System.Collections.Generic.List`1[System.String]..ctor (IEnumerable`1 collection) [0x0002f] in /private/tmp/source/bockbuild/profiles/mono-mac-release/build-root/mono-3.0.7/_build/mono-3.0.7.git/mcs/class/corlib/System.Collections.Generic/List.cs:69 
  at MonoDevelop.VersionControl.Git.GitRepository.GetCurrentRemote () [0x00001] in /Users/michael/Mono/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs:1009 
  at MonoDevelop.VersionControl.Git.GitRepository.GetSupportedOperations (MonoDevelop.VersionControl.VersionInfo vinfo) [0x00009] in /Users/michael/Mono/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs:361 
  at MonoDevelop.VersionControl.VersionInfo.get_AllowedOperations () [0x0001f] in /Users/michael/Mono/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionInfo.cs:115 
  at MonoDevelop.VersionControl.VersionInfo.SupportsOperation (VersionControlOperation op) [0x00001] in /Users/michael/Mono/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionInfo.cs:123 
  at MonoDevelop.VersionControl.VersionInfo.get_CanCommit () [0x00001] in /Users/michael/Mono/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionInfo.cs:130 
  at MonoDevelop.VersionControl.CommitCommand.Commit (MonoDevelop.VersionControl.VersionControlItemList items, Boolean test) [0x0001c] in /Users/michael/Mono/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/CommitCommand.cs:18 
  at MonoDevelop.VersionControl.CommitCommandHandler.RunCommand (MonoDevelop.VersionControl.VersionControlItemList items, Boolean test) [0x00001] in /Users/michael/Mono/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Commands.cs:139 
  at MonoDevelop.VersionControl.SolutionVersionControlCommandHalder.Update (MonoDevelop.Components.Commands.CommandInfo info) [0x00008] in /Users/michael/Mono/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Commands.cs:64 
  at MonoDevelop.Components.Commands.CommandHandler.InternalUpdate (MonoDevelop.Components.Commands.CommandInfo info) [0x00001] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandHandler.cs:47 
  at MonoDevelop.Components.Commands.CommandManager.DefaultUpdateCommandInfo (MonoDevelop.Components.Commands.ActionCommand cmd, MonoDevelop.Components.Commands.CommandInfo info) [0x00083] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:1271 
  at MonoDevelop.Components.Commands.CommandManager.GetCommandInfo (System.Object commandId, MonoDevelop.Components.Commands.CommandTargetRoute targetRoute) [0x001c2] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:1236
Comment 1 Greg Brant 2013-05-30 16:12:16 UTC
I get the same error. I'm not sure but I think it started appearing after I added an upstream to my repo with 

> git branch --track origin/master

I'm using Xamarin Studio 4.0.8 Build 2 on Windows 8 Pro (v6.2 Build 9200).

Exception details
==============================


System.ArgumentException: Invalid wildcards +refs/pull/*/head:refs/remotes/origin/pr/*
   at NGit.Transport.RefSpec..ctor(String spec)
   at NGit.Transport.RemoteConfig..ctor(Config rc, String remoteName)
   at NGit.Transport.RemoteConfig.GetAllRemoteConfigs(Config rc)
   at MonoDevelop.VersionControl.Git.GitRepository.<GetRemotes>d__27.MoveNext()
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at MonoDevelop.VersionControl.Git.GitRepository.GetCurrentRemote()
   at MonoDevelop.VersionControl.Git.GitRepository.GetSupportedOperations(VersionInfo vinfo)
   at MonoDevelop.VersionControl.VersionInfo.get_AllowedOperations()
   at MonoDevelop.VersionControl.VersionInfo.SupportsOperation(VersionControlOperation op)
   at MonoDevelop.VersionControl.VersionInfo.get_CanAdd()
   at MonoDevelop.VersionControl.VersionControlService.<OnFileAdded>b__f(VersionInfo i)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at MonoDevelop.VersionControl.VersionControlService.OnFileAdded(Object s, ProjectFileEventArgs e)
   at MonoDevelop.Projects.ProjectFileEventHandler.Invoke(Object sender, ProjectFileEventArgs e)
   at MonoDevelop.Ide.RootWorkspace.NotifyFileAddedToProject(Object sender, ProjectFileEventArgs e)
   at __ProjectFileEventHandler_DelegateFactory_3.Dispatch(Object )
   at MonoDevelop.Ide.Gui.GuiSyncContext.AsyncDispatch(StatefulMessageHandler cb, Object ob)
   at __ProjectFileEventHandler_DelegateFactory_3.ProxyCall(Object , ProjectFileEventArgs )
   at MonoDevelop.Projects.Solution.OnFileAddedToProject(ProjectFileEventArgs args)
   at MonoDevelop.Projects.SolutionFolder.OnFileAddedToProject(ProjectFileEventArgs e)
   at MonoDevelop.Projects.SolutionFolder.NotifyFileAddedToProject(Object sender, ProjectFileEventArgs e)
   at MonoDevelop.Projects.ProjectFileEventHandler.Invoke(Object sender, ProjectFileEventArgs e)
   at MonoDevelop.Projects.Project.OnFileAddedToProject(ProjectFileEventArgs e)
   at MonoDevelop.MonoDroid.MonoDroidProject.OnFileAddedToProject(ProjectFileEventArgs args)
   at MonoDevelop.Projects.Project.NotifyFileAddedToProject(IEnumerable`1 objs)
   at MonoDevelop.Projects.Project.OnItemsAdded(IEnumerable`1 objs)
   at MonoDevelop.Projects.DotNetProject.OnItemsAdded(IEnumerable`1 objs)
   at MonoDevelop.Projects.ProjectItemCollection`1.NotifyAdded(IEnumerable`1 items, Boolean comesFromParent)
   at MonoDevelop.Projects.ProjectItemCollection`1.MonoDevelop.Projects.IItemListHandler.InternalAdd(IEnumerable`1 objs, Boolean comesFromParent)
   at MonoDevelop.Projects.ProjectItemCollection`1.NotifyAdded(IEnumerable`1 items, Boolean comesFromParent)
   at MonoDevelop.Projects.ProjectItemCollection`1.OnItemAdded(T item)
   at MonoDevelop.Projects.ItemCollection`1.InsertItem(Int32 index, T item)
   at System.Collections.ObjectModel.Collection`1.Add(T item)
   at MonoDevelop.Projects.Project.AddFile(String filename, String buildAction)
   at MonoDevelop.Ide.Templates.SingleFileDescriptionTemplate.AddFileToProject(SolutionItem policyParent, Project project, String language, String directory, String name)
   at MonoDevelop.Ide.Templates.SingleFileDescriptionTemplate.AddToProject(SolutionItem policyParent, Project project, String language, String directory, String name)
   at MonoDevelop.Ide.Templates.FileTemplate.CreateFile(FileDescriptionTemplate newfile, SolutionItem policyParent, Project project, String directory, String language, String name)
   at MonoDevelop.Ide.Templates.FileTemplate.Create(SolutionItem policyParent, Project project, String directory, String language, String name)
   at MonoDevelop.Ide.Projects.NewFileDialog.OpenEvent(Object sender, EventArgs e)
Comment 2 Marius Ungureanu 2013-07-12 11:28:42 UTC
This will be fixed with the next update done to NGit.
Comment 3 Marius Ungureanu 2013-07-15 09:19:04 UTC
As an update, link to JGit change: https://github.com/eclipse/jgit/commit/a51899c2036984fa7a04290ca1364a02af34f95a
Comment 4 Marius Ungureanu 2013-08-06 09:51:05 UTC
*** Bug 13760 has been marked as a duplicate of this bug. ***
Comment 5 Marius Ungureanu 2014-08-25 21:52:38 UTC
This should be fixed with libgit2sharp port.
Comment 6 Abhishek 2015-05-05 13:20:31 UTC
I have tried but not sure how to reproduce this issue at my end.

Could you please provide me steps so that I can reproduce and verify this issue
at my end.

Thanks.
Comment 7 Marius Ungureanu 2015-05-05 13:55:37 UTC
1. Checkout a repository.
2. Go to: /path/to/repository/.git/config and look for [remote "origin"]
3. Change

fetch = +refs/heads/*:refs/remotes/origin/*

to

fetch = +refs/pull/*/head:refs/heads/*:refs/remotes/origin/pr/*

4. Verify that Update does not give an error.
Comment 8 Abhishek 2015-05-05 14:18:56 UTC
Thanks @Marius,

I have checked this issue with XamarinStudio-6.0.0.541.Now this issue is working fine.Here is the screencast for the same: http://www.screencast.com/t/f5mkopfGlOZ

Hence closing this issue.
Comment 9 Marius Ungureanu 2015-05-05 14:49:28 UTC
*** Bug 20401 has been marked as a duplicate of this bug. ***
Comment 10 Abhishek 2015-05-06 06:14:31 UTC
@Marius,

While performing the same steps on bug 20401, I am getting error.Here is the screencast for the same: http://www.screencast.com/t/cih6YMjdWk

Steps I followed:
1. Checkout an already published repository.
2.  Perform the steps define on comment 7.
3. Add the folder to the solution and then add the file.
4. It will give the error.

Error Output: https://gist.github.com/Abhishekk360/67fcff25c4447237a441

Note :If I am using this command fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
which is given in the link https://gist.github.com/piscisaureus/3342247.Then issue is working fine.

Environment Info:

Xamarin Studio
Version 6.0 (build 541)
Comment 11 Marius Ungureanu 2015-05-06 07:17:40 UTC
At Abhishek, yes, my fault. I copy pasted it wrong. The refspec on the link is the good one.