mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 15:36:21 -04:00
18 lines
322 B
Bash
Executable file
18 lines
322 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
gitdir="$(git rev-parse --git-dir)" || exit
|
|
opfound=
|
|
fcnt=
|
|
for i in cherry-pick merge rebase revert; do
|
|
f=${i^^}
|
|
f=${f/-/_}
|
|
test -f "${gitdir}/${f}_HEAD" && fcnt=1$fcnt && opfound=$i
|
|
done
|
|
|
|
if [ "${fcnt}" != 1 ]; then
|
|
echo "I don't know what to abort" >&2
|
|
exit 1
|
|
fi
|
|
|
|
git "${opfound}" --abort
|