-
Notifications
You must be signed in to change notification settings - Fork 408
"Undo Last Discard" restores files with same name with content of one of the files #2172
Description
Prerequisites
- Put an X between the brackets on this line if you have done all of the following:
- Reproduced the problem in Safe Mode: https://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode
- Followed all applicable steps in the debugging guide: https://flight-manual.atom.io/hacking-atom/sections/debugging/
- Checked the FAQs on the message board for common solutions: https://discuss.atom.io/c/faq
- Checked that your issue isn't already filed: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aatom
- Checked that there is not already an Atom package that provides the described functionality: https://atom.io/packages
Description
I encountered a bug that made me lose tons of work (see this thread). I am new to git, but this is probably not a desired behavior, espacially that the manipulation I did is typically something you would do when you discover Git. I did it using Atom so I will describe the steps to reproduce it on Atom. However, I don't think that's related to Atom. Here is how to reproduce it:
Steps to Reproduce
Step 1. Create a new project in Atom (My Project)
Step 2. In the project create a folder (Folder 1)
Step 3. In that project create a source file (aFile.jl) and write "This is the file in folder 1" in it, save
Step 4. Duplicate Folder 1 twice, name the new folders Folder 2 and Folder 3 respectively.
Step 5. Change the text in Folder 2/aFile.jl to "This is the file in folder 2", save. Do the same in folder 3 but with a 3.
Step 6. In the Git tab, initialize a new repository. Your project tree should now look like this:
> My Project
> .git
> Folder 1
- aFile.jl
> Folder 2
- aFile.jl
> Folder 3
- aFile.jl
Step 7. In the Git tab, the three files should be awaiting in unstaged changes. Click on the ... next to it and discard all changes. If you now check the tree the "aFile.jl" files disapeared.
Step 8. In the Git tab, click on the same ... and undo last discard. This will bring back the files.
Expected behavior:
Files have their original (different) content.
Actual behavior:
However, if you check their contents, the "aFile.jl" files now have the same content. Which means that the undo picked a single file and wrote it in every folder. I know that Step 7. is stupid, but I that's not how this should have behaved.
Reproduces how often:
100%
Versions
macOS 10.12.6 with 1.39.0-nightly19.