Commit d408ac1
git-checkout: Support branchless commits
When creating a database from a git repository, bender currently fetches
all branches and tags from the remote before checking out the specified
reference. However, it is possible that a commit does not belong to a
branch or a tag. For instance, GitHub creates PR merge commits and
stores their references in `refs/pull`. To checkout such a branchless
commit, it must first be fetched explicitly.
Therefore, when creating the database, explicitly fetch the specified
reference in addition to all branches and tags (those are still needed
e.g. for `bender update`).
An open corner case is when `Bender.lock` is updated with a branchless
commit hash after creating the database, but the manifest is not. This
will skip fetching altogether and the database might not contain the
desired branchless commit. A possible solution would be to track the
modification time of `Bender.lock`; see `manifest_mtime`. However, since
this is not the intended use of bender and, in a similar form, already
possible today, I chose not to address this for now.
Context: The pulp-action
[integrate](https://github.com/pulp-platform/pulp-actions/tree/main/integrate)
currently does not work for `pull_request` events, since the run's
context (the PR merge commit) is not accessible by the dependent's CI
due to the issue addressed by this PR. (see
https://github.com/pulp-platform/cva6/actions/runs/10512893871/job/29127223222)
Signed-off-by: Nils Wistoff <nwistoff@iis.ee.ethz.ch>1 parent a6b1c8b commit d408ac1
2 files changed
Lines changed: 25 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
157 | 164 | | |
158 | 165 | | |
159 | 166 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
460 | 460 | | |
461 | 461 | | |
462 | 462 | | |
463 | | - | |
| 463 | + | |
464 | 464 | | |
465 | 465 | | |
466 | 466 | | |
| |||
477 | 477 | | |
478 | 478 | | |
479 | 479 | | |
| 480 | + | |
480 | 481 | | |
481 | 482 | | |
482 | 483 | | |
| |||
533 | 534 | | |
534 | 535 | | |
535 | 536 | | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
536 | 544 | | |
537 | 545 | | |
538 | 546 | | |
| |||
559 | 567 | | |
560 | 568 | | |
561 | 569 | | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
562 | 577 | | |
563 | 578 | | |
564 | 579 | | |
| |||
841 | 856 | | |
842 | 857 | | |
843 | 858 | | |
844 | | - | |
| 859 | + | |
845 | 860 | | |
846 | 861 | | |
847 | 862 | | |
| |||
1041 | 1056 | | |
1042 | 1057 | | |
1043 | 1058 | | |
1044 | | - | |
| 1059 | + | |
1045 | 1060 | | |
1046 | 1061 | | |
1047 | 1062 | | |
| |||
0 commit comments