Bug 306957
| Summary: | git-webkit update fails when run from a git worktree | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | David Kilzer (:ddkilzer) <ddkilzer> |
| Component: | Tools / Tests | Assignee: | David Kilzer (:ddkilzer) <ddkilzer> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
David Kilzer (:ddkilzer)
When running `git-webkit update` (or `git-webkit pfr`) from a git worktree, the command fails with the error:
```
fatal: refusing to fetch into branch 'refs/heads/main' checked out at '<main-repository-path>'
```
The issue occurs because the `pull()` method in `local/git.py` runs `git fetch origin main:main` to update the local branch reference before rebasing. Git refuses to update a branch that is checked out in any worktree (including the main repository checkout) as a safety mechanism to prevent data corruption.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/169630851>
David Kilzer (:ddkilzer)
Pull request: https://github.com/WebKit/WebKit/pull/57868
Sam Sneddon [:gsnedders]
(In reply to David Kilzer (:ddkilzer) from comment #0)
> `git-webkit pfr`
Bug 254020 is an earlier report of that not working with `main` checked out elsewhere, fwiw, which can probably be forward-duped to this given this has a PR.
EWS
Committed 307764@main (6adb0db78d8f): <https://commits.webkit.org/307764@main>
Reviewed commits have been landed. Closing PR #57868 and removing active labels.