Use git pull --autostash
in omarchy-update
This is a minor follow-up to dcc40719793d52d43698108a0b0784c2f3b48655 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:
parent
45b5d3ea47
commit
cc0ac314ef
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user