mirror of
https://github.com/basecamp/omarchy.git
synced 2025-07-27 12:19:24 +00:00
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:
@ -11,9 +11,7 @@ else
|
||||
fi
|
||||
|
||||
# Get the latest while trying to preserve any modifications
|
||||
git stash
|
||||
git pull
|
||||
git stash pop
|
||||
git pull --autostash
|
||||
|
||||
# Run any pending migrations
|
||||
for file in migrations/*.sh; do
|
||||
|
Reference in New Issue
Block a user