Merge pull request #894 from alessandro308/merge-into-stashed

Merge-into: add stash before to checkout
This commit is contained in:
罗泽轩 2020-11-16 19:16:18 +08:00 committed by GitHub
commit 18bcfcd38e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,6 +9,15 @@ usage() {
}
cur_branch=$(current_branch)
stashed=0
if [ -n "$(git status --porcelain)" ];
then
echo "Local modifications detected, stashing"
stashed=1
git stash
fi
if [ "${!#}" == '--ff-only' ]; then
case $# in
2 ) # dest --ff
@ -32,3 +41,8 @@ else
usage
esac
fi
if [ $stashed -eq 1 ];
then
git stash pop;
fi