oh-my-fish/pkg/omf/cli/omf.update.fish
Bruno Pinto 20ed43983b Naming functions with omf. namespace.
Having a clear namespace `omf.` improves the readability of the code as
we clarify what is the function name and what is the namespace.
2015-08-28 18:24:56 +09:00

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