Commit 456ae18
fix(vcs): Handle non-github workflow in find_base_sha
`find_head_sha` supported both Github workflow contexts and 'raw git'
contexts however the matching function `find_base_sha` did not handle
raw git contexts.
Thi updates `find_base_sha` to return the equivalent of:
`git merge-base HEAD origin/HEAD`. For:
```
o---o---o---origin/main
/
---1---o---o---o---foo
```
We return the SHA of 1.
Apply suggestion from @szokeasaurusrex
Co-authored-by: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com>
Update src/utils/vcs.rs
Co-authored-by: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com>1 parent 9bb7550 commit 456ae18
3 files changed
+30
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
10 | 14 | | |
11 | 15 | | |
12 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
236 | | - | |
| 236 | + | |
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
569 | 569 | | |
570 | 570 | | |
571 | 571 | | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
577 | 585 | | |
578 | | - | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
579 | 596 | | |
580 | 597 | | |
581 | 598 | | |
| |||
1773 | 1790 | | |
1774 | 1791 | | |
1775 | 1792 | | |
1776 | | - | |
| 1793 | + | |
1777 | 1794 | | |
1778 | 1795 | | |
1779 | 1796 | | |
1780 | 1797 | | |
1781 | 1798 | | |
1782 | 1799 | | |
1783 | 1800 | | |
1784 | | - | |
| 1801 | + | |
1785 | 1802 | | |
1786 | 1803 | | |
1787 | 1804 | | |
0 commit comments