mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 15:36:21 -04:00
Merge pull request #894 from alessandro308/merge-into-stashed
Merge-into: add stash before to checkout
This commit is contained in:
commit
18bcfcd38e
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue