File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,8 @@ pub async fn gh_range_diff(
57
57
repository : repo. to_string ( ) ,
58
58
} ;
59
59
60
+ let gh_repo = ctx. github . repository ( & format ! ( "{owner}/{repo}" ) ) . await ?;
61
+
60
62
// Determine the oldbase and get the comparison for the old diff
61
63
let old = async {
62
64
// We need to determine the oldbase (ie. the parent sha of all the commits of old).
@@ -73,7 +75,7 @@ pub async fn gh_range_diff(
73
75
// is always correct no matter the order.
74
76
let oldbase = ctx
75
77
. github
76
- . compare ( & issue_repo, "master" , oldhead)
78
+ . compare ( & issue_repo, & gh_repo . default_branch , oldhead)
77
79
. await
78
80
. context ( "failed to retrive the comparison between newhead and oldhead" ) ?
79
81
. merge_base_commit
@@ -98,9 +100,9 @@ pub async fn gh_range_diff(
98
100
// See the comment above on old for more details.
99
101
let newbase = ctx
100
102
. github
101
- . compare ( & issue_repo, "master" , newhead)
103
+ . compare ( & issue_repo, & gh_repo . default_branch , newhead)
102
104
. await
103
- . context ( "failed to retrive the comparison between master and newhead" ) ?
105
+ . context ( "failed to retrive the comparison between the default branch and newhead" ) ?
104
106
. merge_base_commit
105
107
. sha ;
106
108
You can’t perform that action at this time.
0 commit comments