fisher/functions/__fisher_path_update.fish
Jorge Bucaran ed335bf270
Ahoy! Fisherman 1.3.0
* Fix bug in fisher_config_color_reset not declaring path variable.
* Silence Git checkout standard error to prevent update failures in some edge cases.
* Revise and correct errors in the documentation and README.
* Add more instrumentation to fisher_plugin_disable.
* Minor doc updates.
2016-03-12 06:45:17 +09:00

28 lines
615 B
Fish

function __fisher_path_update -a path
pushd $path
set -l branch
if not set branch (sed "s|.*/||" < .git/HEAD)
return 1
end
git stash --quiet ^ /dev/null
git checkout master --quiet ^ /dev/null
if not git pull --quiet --rebase origin master
git rebase --quiet --abort
git fetch --quiet origin master
git reset --quiet --hard FETCH_HEAD
git clean --quiet -d --force
end ^ /dev/null
if test ! -z "$branch"
git checkout "$branch" --quiet ^ /dev/null
end
git stash apply --quiet ^ /dev/null
popd
end