Bug 14236 - Copy, paste & rename adds file with wrong name
Summary: Copy, paste & rename adds file with wrong name
Status: VERIFIED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Version Control ()
Version: Trunk
Hardware: PC Linux
: Normal normal
Target Milestone: master
Assignee: Marius Ungureanu
URL:
: 16899 ()
Depends on:
Blocks:
 
Reported: 2013-08-26 08:44 UTC by Federico Di Gregorio
Modified: 2015-08-20 03:23 UTC (History)
4 users (show)

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


Attachments
Show results of steps described in comment 2 (571.15 KB, image/jpeg)
2013-08-27 12:08 UTC, Federico Di Gregorio
Details


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 Federico Di Gregorio 2013-08-26 08:44:13 UTC
When a file "XXX.cs" is copied and pasted in the solution tree of VC-enabled (git in this case) project, it is added to the index with the new name "XXX (copy).cs". If the file is later renamed in the solution panel the change doesn't propagate to git and the index keeps the old name. This is visible by doing the copy+paste+rename and then opening the "Version Control->Review Solution and Commit" panel.
Comment 1 Marius Ungureanu 2013-08-27 11:13:36 UTC
This doesn't happen with the most recent internal build. What version are you testing this on?
Comment 2 Federico Di Gregorio 2013-08-27 12:08:04 UTC
Fresh build from master. I attach the results of a 3-step procedure to reproduce the bug.

1) Create a new C# Console project, init the git (or publish it somewhere): you get a clean project with just 1 file and the Review
Solution and Commit panel is empty.

2) Copy and paste a file. Now Review Solution and Commit panel shows your new file (and the project, obviously).

3) Click on the "(copy)" file, F2 and rename it. Reopen the Review Solution and Commit panel shows still the old name, not the new one. Also, a "git status" from the command line shows that the index is quite messed up with the "(copy)" file both added and removed and the new, renamed file still untracked.

$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#	nuovo file:   GitBroken/Program (another copy).cs
#
# Changes not staged for commit:
#   (use "git add/rm <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#	modificato:   GitBroken/GitBroken.csproj
#	eliminato:    GitBroken/Program (another copy).cs
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#	GitBroken.userprefs
#	GitBroken/Program2.cs
Comment 3 Federico Di Gregorio 2013-08-27 12:08:51 UTC
Created attachment 4723 [details]
Show results of steps described in comment 2
Comment 4 Marius Ungureanu 2014-04-28 11:11:52 UTC
*** Bug 16899 has been marked as a duplicate of this bug. ***
Comment 5 Marius Ungureanu 2014-10-05 05:19:49 UTC
This seems to be fixed in the new libgit2sharp provider support. Changing milestone.
Comment 6 Abhishek 2015-04-30 11:39:26 UTC
I have check this issue with XamarinStudio-6.0.0.514. Now this issue is working
fine. Here is the screencast: http://www.screencast.com/t/59Pa6egb34

Hence closing this issue.