Statocles icon indicating copy to clipboard operation
Statocles copied to clipboard

Handle SIGINT during git deploy to switch back branches

Open preaction opened this issue 9 years ago • 0 comments

When we're deploying to a git repo, we often need to switch branches. I've been having a problem with my deploy target where it doesn't respond to push. So, I eventually Ctrl+C to stop. This leaves me on the other branch, forcing me to switch back to master before being able to run the deploy again.

If we add a handler for SIGINT, we can try to move back to the original branch when there's a problem. We must not leave the branch in an inconsistent state, though, so if there's uncommitted content, we must not switch branches (git will complain, anyway).

preaction avatar Feb 10 '16 15:02 preaction