mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2024-12-05 08:30:50 +08:00
16 lines
397 B
Fish
16 lines
397 B
Fish
|
function omf_update
|
||
|
set -l repo "upstream"
|
||
|
test -z (git config --get remote.upstream.url)
|
||
|
and set -l repo "origin"
|
||
|
|
||
|
if git diff-index --quiet HEAD -- >/dev/null ^&1
|
||
|
git pull $repo master >/dev/null ^&1
|
||
|
else
|
||
|
git stash >/dev/null ^&1
|
||
|
if git pull --rebase $repo master >/dev/null ^&1
|
||
|
git stash apply >/dev/null ^&1
|
||
|
else
|
||
|
omf_util_sync "origin"
|
||
|
end
|
||
|
end
|
||
|
end
|