@@ -6,7 +6,7 @@ use crate::utils::{run_command, stream_command};
6
6
use anyhow:: { Context , Error } ;
7
7
use std:: path:: { Path , PathBuf } ;
8
8
9
- pub const UPSTREAM_REPO : & str = "rust-lang/rust" ;
9
+ pub const DEFAULT_UPSTREAM_REPO : & str = "rust-lang/rust" ;
10
10
11
11
pub enum RustcPullError {
12
12
/// No changes are available to be pulled.
@@ -35,13 +35,13 @@ impl GitSync {
35
35
Self { context, proxy }
36
36
}
37
37
38
- pub fn rustc_pull ( & self ) -> Result < PullResult , RustcPullError > {
38
+ pub fn rustc_pull ( & self , upstream_repo : String ) -> Result < PullResult , RustcPullError > {
39
39
// The upstream commit that we want to pull
40
40
let upstream_sha = {
41
41
let out = run_command ( [
42
42
"git" ,
43
43
"ls-remote" ,
44
- & format ! ( "https://github.com/{UPSTREAM_REPO }" ) ,
44
+ & format ! ( "https://github.com/{upstream_repo }" ) ,
45
45
"HEAD" ,
46
46
] )
47
47
. context ( "cannot fetch upstream commit" ) ?;
@@ -59,7 +59,7 @@ impl GitSync {
59
59
. start ( & self . context . config )
60
60
. context ( "cannot start josh-proxy" ) ?;
61
61
let josh_url = josh. git_url (
62
- UPSTREAM_REPO ,
62
+ & upstream_repo ,
63
63
Some ( & upstream_sha) ,
64
64
& self . context . config . construct_josh_filter ( ) ,
65
65
) ;
@@ -98,7 +98,7 @@ impl GitSync {
98
98
} ) ?;
99
99
100
100
let prep_message = format ! (
101
- r#"Prepare for merging from {UPSTREAM_REPO }
101
+ r#"Prepare for merging from {upstream_repo }
102
102
103
103
This updates the rust-version file to {upstream_sha}."# ,
104
104
) ;
@@ -144,9 +144,9 @@ This updates the rust-version file to {upstream_sha}."#,
144
144
println ! ( "incoming ref: {incoming_ref}" ) ;
145
145
146
146
let merge_message = format ! (
147
- r#"Merge ref '{upstream_head_short}' from {UPSTREAM_REPO }
147
+ r#"Merge ref '{upstream_head_short}' from {upstream_repo }
148
148
149
- Pull recent changes from https://github.com/{UPSTREAM_REPO } via Josh.
149
+ Pull recent changes from https://github.com/{upstream_repo } via Josh.
150
150
151
151
Upstream ref: {upstream_sha}
152
152
Filtered ref: {incoming_ref}
@@ -241,7 +241,7 @@ This merge was created using https://github.com/rust-lang/josh-sync.
241
241
& [
242
242
"git" ,
243
243
"fetch" ,
244
- & format ! ( "https://github.com/{UPSTREAM_REPO }" ) ,
244
+ & format ! ( "https://github.com/{DEFAULT_UPSTREAM_REPO }" ) ,
245
245
& base_upstream_sha,
246
246
] ,
247
247
& rustc_git,
0 commit comments