Bugfix auto-stashing in 'get branch'
This commit is contained in:
parent
65a868210d
commit
afba5f9252
1 changed files with 2 additions and 2 deletions
4
bin/get
4
bin/get
|
|
@ -68,13 +68,13 @@ echo 'Switching to branch'
|
||||||
if [ -z "$2" ]; then
|
if [ -z "$2" ]; then
|
||||||
echo '! Specify branch name'
|
echo '! Specify branch name'
|
||||||
else
|
else
|
||||||
git stash # Save branch index state
|
git stash save --include-untracked --quiet 'get-branch autostash' # Save branch index state
|
||||||
if git rev-parse --verify --quiet "$2" > /dev/null; then
|
if git rev-parse --verify --quiet "$2" > /dev/null; then
|
||||||
git checkout "$2"
|
git checkout "$2"
|
||||||
else
|
else
|
||||||
git checkout -b "$2"
|
git checkout -b "$2"
|
||||||
fi
|
fi
|
||||||
git stash pop # Restore branch index state
|
git stash pop --quiet # Restore branch index state
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue