Last active
December 15, 2019 21:44
-
-
Save mgershovitz/4099de6278d7daa67e5c8610492fbb21 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function git { | |
if [[ "$1" = "merge" && "$@" != *"--help"* && "$@" != *"--abort"* ]]; then | |
git_merge_wrapper "$@"; | |
else | |
command git "$@" | |
fi | |
} | |
function git_merge_wrapper { | |
command git "$@" | |
ret_code=$? | |
if [[ "$ret_code" != 0 ]]; then | |
command git merge --abort | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment