dmusican / Elegit

A GUI client for people who want to learn Git.
MIT License
30 stars 7 forks source link

Reverting when the repo has changes in the working directory should produce a visible error #611

Open dmusican opened 6 years ago

dmusican commented 6 years ago

In standard git, if you issue a "git revert" command when there are changes in the working directory present, this error results:

error: Your local changes to the following files would be overwritten by merge:
    file0
Please, commit your changes or stash them before you can merge.
Aborting

In Elegit, issuing a revert in the same situation has no effect, but there is no visible error to the user. This should happen automatically if JGit throws an exception in this case. On my preliminary investigation, it looks to me like JGit doesn't. Verify if this is true, or if we're inadvertently intercepting such an exception. if JGit really doesn't throw an exception here (yuck), we've got to check for this ourselves, and throw our own.