mirror of
https://github.com/oh-my-fish/oh-my-fish
synced 2024-11-15 12:12:45 +00:00
20ed43983b
Having a clear namespace `omf.` improves the readability of the code as we clarify what is the function name and what is the namespace.
17 lines
398 B
Fish
17 lines
398 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
|