Bug 11678 - Renamed files are not updated in the project
Summary: Renamed files are not updated in the project
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Version Control ()
Version: 4.0.3
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Marius Ungureanu
URL:
Depends on:
Blocks:
 
Reported: 2013-04-09 09:28 UTC by Peter Hultqvist
Modified: 2013-07-08 05:34 UTC (History)
2 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:
RESOLVED FIXED

Description Peter Hultqvist 2013-04-09 09:28:42 UTC
Steps to reproduce

1a. Select a file in the solution and choose rename.

Sharpen.CharacterCodingException: Exception of type 'Sharpen.CharacterCodingException' was thrown.
   at Sharpen.Extensions.Decode(Encoding e, Byte[] chars, Int32 start, Int32 len)
   at Sharpen.Extensions.Decode(Encoding e, ByteBuffer buffer)
   at NGit.Dircache.DirCacheEntry.ToString(Byte[] path)
   at NGit.Dircache.DirCacheEntry.get_PathString()
   at MonoDevelop.VersionControl.Git.GitRepository.OnRevert(FilePath[] localPaths, Boolean recurse, IProgressMonitor monitor)
   at MonoDevelop.VersionControl.Repository.Revert(FilePath[] localPaths, Boolean recurse, IProgressMonitor monitor)
   at MonoDevelop.VersionControl.Repository.Revert(FilePath localPath, Boolean recurse, IProgressMonitor monitor)
   at MonoDevelop.VersionControl.Git.GitRepository.OnMoveFile(FilePath localSrcPath, FilePath localDestPath, Boolean force, IProgressMonitor monitor)
   at MonoDevelop.VersionControl.Repository.MoveFile(FilePath localSrcPath, FilePath localDestPath, Boolean force, IProgressMonitor monitor)
   at MonoDevelop.VersionControl.VersionControlFileSystemExtension.MoveFile(FilePath source, FilePath dest)
   at MonoDevelop.VersionControl.VersionControlFileSystemExtension.RenameFile(FilePath file, String newName)
   at MonoDevelop.Core.FileService.InternalRenameFile(String srcFile, String newName)
   at MonoDevelop.Core.FileService.RenameFile(String oldName, String newName)
   at MonoDevelop.Ide.Gui.Pads.ProjectPad.ProjectFileNodeCommandHandler.RenameItem(String newName)
   at MonoDevelop.Ide.Gui.Components.ExtensibleTreeView.HandleOnEdit(Object o, EditedArgs e)

1b. In the editor rename a class and have the rename file checkbox checked.

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Sharpen.CharacterCodingException: Exception of type 'Sharpen.CharacterCodingException' was thrown.
   at Sharpen.Extensions.Decode(Encoding e, Byte[] chars, Int32 start, Int32 len)
   at Sharpen.Extensions.Decode(Encoding e, ByteBuffer buffer)
   at NGit.Dircache.DirCacheEntry.ToString(Byte[] path)
   at NGit.Dircache.DirCacheEntry.get_PathString()
   at MonoDevelop.VersionControl.Git.GitRepository.OnRevert(FilePath[] localPaths, Boolean recurse, IProgressMonitor monitor)
   at MonoDevelop.VersionControl.Repository.Revert(FilePath[] localPaths, Boolean recurse, IProgressMonitor monitor)
   at MonoDevelop.VersionControl.Repository.Revert(FilePath localPath, Boolean recurse, IProgressMonitor monitor)
   at MonoDevelop.VersionControl.Git.GitRepository.OnMoveFile(FilePath localSrcPath, FilePath localDestPath, Boolean force, IProgressMonitor monitor)
   at MonoDevelop.VersionControl.Repository.MoveFile(FilePath localSrcPath, FilePath localDestPath, Boolean force, IProgressMonitor monitor)
   at MonoDevelop.VersionControl.VersionControlFileSystemExtension.MoveFile(FilePath source, FilePath dest)
   at MonoDevelop.VersionControl.VersionControlFileSystemExtension.RenameFile(FilePath file, String newName)
   at MonoDevelop.Core.FileService.InternalRenameFile(String srcFile, String newName)
   at MonoDevelop.Core.FileService.RenameFile(String oldName, String newName)
   at MonoDevelop.Refactoring.RenameFileChange.PerformChange(IProgressMonitor monitor, RefactoringOptions rctx)
   at MonoDevelop.Refactoring.RefactoringService.AcceptChanges(IProgressMonitor monitor, List`1 changes, ITextFileProvider fileProvider)
   at MonoDevelop.Refactoring.RefactoringService.AcceptChanges(IProgressMonitor monitor, List`1 changes)
   at MonoDevelop.Refactoring.Rename.RenameItemDialog.OnOKClicked(Object sender, EventArgs e)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at GLib.Signal.ClosureInvokedCB(Object o, ClosureInvokedArgs args)
   at GLib.SignalClosure.Invoke(ClosureInvokedArgs args)
   at GLib.SignalClosure.MarshalCallback(IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data)

For 1a the file remain in the project with its original name but in red because the file with that name is no longer there. The file on disk has been renamed correctly.

For 1b The file on disk is renamed but its content is not changed.

The workaround now is to remove the broken file and add the renamed file back to the project.
Comment 1 Mikayla Hutchinson [MSFT] 2013-04-09 17:17:07 UTC
This is an error in the git integration.
Comment 2 Marius Ungureanu 2013-07-08 04:59:08 UTC
Could you add the project as an attachment, or a similar project? It might be related to the character encoding you use, and we have no info on that.
Comment 3 Peter Hultqvist 2013-07-08 05:34:16 UTC
Tested on 4.0.9 and I cannot reproduce the bug anymore.
Looks like it is fixed now.