Use git pull --autostash in omarchy-update

This is a minor follow-up to dcc4071979
to leverage the `--autostash` flag of `git pull` which does the same
thing we were doing in three separate commands.

This also avoids the possibility of popping something from the stash
that `omarchy-update` didn't actually stash. In other words, if the
initial `git stash` was a no-op (because there were no changes in the
working tree), it's actually not desirable for `omarchy-update` to
`git stash pop` at the end, since that potentially pops something the
user had manually stashed (we only want `omarchy-update` to pop its own
stash entry). Using `--autostash` handles this correctly.

Ref:
https://git-scm.com/docs/git-pull#Documentation/git-pull.txt---autostash
This commit is contained in:
Richard Macklin
2025-07-17 19:13:35 -07:00
parent 45b5d3ea47
commit cc0ac314ef

View File

@ -11,9 +11,7 @@ else
fi fi
# Get the latest while trying to preserve any modifications # Get the latest while trying to preserve any modifications
git stash git pull --autostash
git pull
git stash pop
# Run any pending migrations # Run any pending migrations
for file in migrations/*.sh; do for file in migrations/*.sh; do