mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4571] [Other] update.sh / UPDATE.bat: a failed pull without origin/main is not the old history #5096
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#5096
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/4571
Author: @Nyarlathoteppppp
Created: 10/29/2026
Status: 🔄 Open
Base:
main← Head:fix/4390-update-no-main📝 Commits (1)
1af3466update: a failed pull on a clone without origin/main is not the old history (#4390)📊 Changes
3 files changed (+62 additions, -1 deletions)
View changed files
📝
UPDATE.bat(+1 -0)➕
tests/terminal/test_update_sh_no_main.py(+60 -0)📝
update.sh(+1 -1)📄 Description
Problem and result
update.shtakes its "old history" recovery when! git merge-base HEAD origin/mainsucceeds. That is also true whenorigin/maindoes not exist (merge-base exits 128), so on a fork whose remote has nomain, every ordinarygit pull --ff-onlyfailure is reported as old history and then fails ongit checkout -B <branch> origin/main.UPDATE.bathas the same gate.After the change the old-history path needs
origin/mainto resolve to a commit; otherwise a failed pull gets the existing "git pull did not succeed" message. A real old-history clone is handled as before.Related discussion
Fixes #4390. Focused fix, no scope change.
Approach
update.sh: addgit rev-parse --verify -q 'origin/main^{commit}'to the condition, before the merge-base test.UPDATE.bat: clearREWRwhen that check fails, next to the shallow-clone check.tests/terminal/test_update_sh_no_main.py: a hermetic sandbox (bare origin whose only branch ismemory-core, a diverged clone withupdate.shand a stubsetup.sh) runssh update.shand checks exit 1, "git pull did not succeed", no "old history", nopre-cleanup-backup*branch, and that setup did not run. Skipped on Windows or without git/sh.Validation
Passed:
python -m pytest tests/terminal/test_update_sh_no_main.py: fails on46c152a(old-history path taken) and passes with the fix.python -m pytest tests/terminal/test_packaging_pins.py tests/terminal/test_no_acquisition.py: 19 passed, 2 failed, the same 2 (StartNeverAcquiresTests) as on46c152a.46c152a.Failed:
none beyond the pre-existing failures above.
Not run:
UPDATE.baton Windows (the change is one line next to the existing shallow check), Linux, full test suite.Limits
The ordinary failure message is unchanged; it does not yet suggest merge/rebase for a diverged branch.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.