expandedfronts / revisr

Revisr: Git for WordPress
https://revisr.io
GNU General Public License v3.0
195 stars 41 forks source link

Unstaged files are reverted on a commit #6

Closed jimwebb closed 9 years ago

jimwebb commented 9 years ago

I'm running Revisr 1.8.1 on WP 4.0.1, git 1.9.3 on CentOS.

Observed behavior: If a file is unstaged in Revisr, and a commit made to other (staged) files, the unstaged files are reverted to an earlier version. Changes made to the unstaged files are lost.

Expected behavior: Files that are unstaged should remain as they are on disk when the commit happens.

To reproduce:

Thanks.

jimwebb commented 9 years ago

Hey! Turns out this only happens if you're automatically pushing to a remote repo (Settings > Remote). When that's the case, it looks like revisr is calling "git reset --hard HEAD" after adding the staged files.

expandedfronts commented 9 years ago

Hi Jim,

Thanks for the heads up and detailed report on the issue. That reset was added back in an older version when the workflow was a lot different/more limited (before v1.5). That's why you see the message ("Are you sure you want to discard any uncommitted changes and push to the remote?") when pushing manually.

That reset should no longer be needed so I've removed it on the develop branch and will add the fix in the next release. Thanks again!

expandedfronts commented 9 years ago

Hello,

This has been corrected in the latest release. Please let me know if you run into any further issues. Thanks!