You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
"Undo Last Discard" restores files with same name with content of one of the files #2172
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:
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.
changed the title [-]undo discard mixes up and overwrites files with the same name[/-][+]"Undo Last Discard" restores files with same name with content of one of the files[/+]on Jun 6, 2019
Activity
[-]undo discard mixes up and overwrites files with the same name[/-][+]"Undo Last Discard" restores files with same name with content of one of the files[/+]rsese commentedon Jun 6, 2019
Thanks for the detailed report and I'm really sorry you lost work here. With your steps, I can reproduce on macOS 10.12.6 with 1.39.0-nightly19.
To share one more detail about this, I see the files all have the content "This is the file in folder 3".