@@ -64,19 +64,17 @@ pub async fn handle_job() -> Result<()> {
64
64
65
65
pub async fn docs_update ( ) -> Result < Option < Issue > > {
66
66
let gh = GithubClient :: new_with_default_token ( Client :: new ( ) ) ;
67
+ let dest_repo = gh. repository ( DEST_REPO ) . await ?;
67
68
let work_repo = gh. repository ( WORK_REPO ) . await ?;
68
- work_repo
69
- . merge_upstream ( & gh, & work_repo. default_branch )
70
- . await ?;
71
69
72
70
let updates = get_submodule_updates ( & gh, & work_repo) . await ?;
73
71
if updates. is_empty ( ) {
74
72
tracing:: trace!( "no updates this week?" ) ;
75
73
return Ok ( None ) ;
76
74
}
77
75
78
- create_commit ( & gh, & work_repo, & updates) . await ?;
79
- Ok ( Some ( create_pr ( & gh, & updates) . await ?) )
76
+ create_commit ( & gh, & dest_repo , & work_repo, & updates) . await ?;
77
+ Ok ( Some ( create_pr ( & gh, & dest_repo , & updates) . await ?) )
80
78
}
81
79
82
80
struct Update {
@@ -158,11 +156,12 @@ async fn generate_pr_body(
158
156
159
157
async fn create_commit (
160
158
gh : & GithubClient ,
159
+ dest_repo : & Repository ,
161
160
rust_repo : & Repository ,
162
161
updates : & [ Update ] ,
163
162
) -> Result < ( ) > {
164
- let master_ref = rust_repo
165
- . get_reference ( gh, & format ! ( "heads/{}" , rust_repo . default_branch) )
163
+ let master_ref = dest_repo
164
+ . get_reference ( gh, & format ! ( "heads/{}" , dest_repo . default_branch) )
166
165
. await ?;
167
166
let master_commit = rust_repo. git_commit ( gh, & master_ref. object . sha ) . await ?;
168
167
let tree_entries: Vec < _ > = updates
@@ -186,8 +185,7 @@ async fn create_commit(
186
185
Ok ( ( ) )
187
186
}
188
187
189
- async fn create_pr ( gh : & GithubClient , updates : & [ Update ] ) -> Result < Issue > {
190
- let dest_repo = gh. repository ( DEST_REPO ) . await ?;
188
+ async fn create_pr ( gh : & GithubClient , dest_repo : & Repository , updates : & [ Update ] ) -> Result < Issue > {
191
189
let mut body = String :: new ( ) ;
192
190
for update in updates {
193
191
write ! ( body, "{}\n " , update. pr_body) . unwrap ( ) ;
0 commit comments