twmr / gerrit.el

gerrit integration in emacs
43 stars 6 forks source link

Don't override locally modified by a checkout of a gerrit change #34

Closed twmr closed 2 years ago

twmr commented 2 years ago
  1 integrationtests/ git … checkout review/thomas_hisch/58720
error: Your local changes to the following files would be overwritten by checkout:
    integrationtests/test_data.py
    pytest.ini
Please commit your changes or stash them before you switch branches.
Aborting

  0 integrationtests/ git … reset --hard FETCH_HEAD
HEAD is now at f778b6a WIP add testcase

We have to check the return value of the git checkout command before we start the git reset command.

The exit code is returned by magit-call-git, but currently we are ignoring the return value. The respective code that causes a problem looks like

(progn
(magit-call-git "foobar1")
(magit-call-git "foobar2")) ;; foobar2 is run even though foobar1 failed