mirror of
https://github.com/jorgebucaran/fisher
synced 2024-11-09 07:10:27 +00:00
28 lines
619 B
Fish
28 lines
619 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 --abort > /dev/null
|
|
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
|