Bug 16305 - git: "revert to this revision" fails with exception
Summary: git: "revert to this revision" fails with exception
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Version Control ()
Version: 4.2.x
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: master
Assignee: Marius Ungureanu
URL:
Depends on:
Blocks:
 
Reported: 2013-11-17 11:42 UTC by Jens
Modified: 2014-04-28 12:15 UTC (History)
3 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 Jens 2013-11-17 11:42:43 UTC
If I make "version control" -> "log", chose a revision and click on "revert to this revision" I get an exception.

this should "just work"

---- cut ----

Build Information
Release ID: 402010001
Git revision: 844a84fe0aa0cb5f986d4e3c4807a51487d07845
Build date: 2013-11-13 22:12:16+0000
Xamarin addins: 97e44e4863da6c479427794457637e75b3d22600

Operating System
Mac OS X 10.9.0
Darwin localhost 13.0.0 Darwin Kernel Version 13.0.0
    Thu Sep 19 22:22:27 PDT 2013
    root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64

exception thrown:

System.ArgumentNullException: Argument cannot be null.
Parameter name: s
  at System.Text.Encoding.GetBytes (System.String s) [0x00077] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-3.2.4/mcs/class/corlib/System.Text/Encoding.cs:257 
  at MonoDevelop.Projects.Text.TextFile.WriteFile (FilePath fileName, System.String content, System.String encoding, MonoDevelop.Projects.Utility.ByteOrderMark bom, Boolean onlyIfChanged) [0x00007] in /Users/builder/data/lanes/monodevelop-lion-license-sync/844a84fe/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Text/TextFile.cs:441 
  at MonoDevelop.Projects.Text.TextFile.WriteFile (FilePath fileName, System.String content, System.String encoding, Boolean saveBOM) [0x0001f] in /Users/builder/data/lanes/monodevelop-lion-license-sync/844a84fe/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Text/TextFile.cs:460 
  at MonoDevelop.Projects.Text.TextFile.WriteFile (FilePath fileName, System.String content, System.String encoding) [0x00005] in /Users/builder/data/lanes/monodevelop-lion-license-sync/844a84fe/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Text/TextFile.cs:453 
  at MonoDevelop.VersionControl.Git.GitRepository.OnRevertToRevision (FilePath localPath, MonoDevelop.VersionControl.Revision revision, IProgressMonitor monitor) [0x00059] in /Users/builder/data/lanes/monodevelop-lion-license-sync/844a84fe/source/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs:1022 
  at MonoDevelop.VersionControl.Repository.RevertToRevision (FilePath localPath, MonoDevelop.VersionControl.Revision revision, IProgressMonitor monitor) [0x0000c] in /Users/builder/data/lanes/monodevelop-lion-license-sync/844a84fe/source/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Repository.cs:455 
  at MonoDevelop.VersionControl.RevertRevisionsCommands+RevertWorker.Run () [0x00048] in /Users/builder/data/lanes/monodevelop-lion-license-sync/844a84fe/source/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/RevertRevisionsCommands.cs:109 
  at MonoDevelop.VersionControl.Task.BackgroundWorker (System.Object state) [0x00003] in /Users/builder/data/lanes/monodevelop-lion-license-sync/844a84fe/source/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Task.cs:51
Comment 1 narayanp 2013-11-20 08:06:57 UTC
I have checked this issue with following builds:

Maverick and Lion
X.S 4.2.1 (build 1)
Mono 3.2.4
X.iOS 7.0.4.209
X.Android 4.10.1-68

I am also able to reproduce this issue.
Exception Details: https://gist.github.com/saurabh360/199f92b914929d140519
http://screencast.com/t/U9YtNlqk5ZTK
Comment 2 Marius Ungureanu 2013-11-20 12:46:31 UTC
I'll take a look at this ASAP.
Comment 3 Marius Ungureanu 2014-04-28 12:15:22 UTC
This has been fixed.