@@ -6,7 +6,7 @@ use crate::utils::{run_command, stream_command};
66use anyhow:: { Context , Error } ;
77use std:: path:: { Path , PathBuf } ;
88
9- pub const UPSTREAM_REPO : & str = "rust-lang/rust" ;
9+ pub const DEFAULT_UPSTREAM_REPO : & str = "rust-lang/rust" ;
1010
1111pub enum RustcPullError {
1212 /// No changes are available to be pulled.
@@ -35,13 +35,13 @@ impl GitSync {
3535 Self { context, proxy }
3636 }
3737
38- pub fn rustc_pull ( & self ) -> Result < PullResult , RustcPullError > {
38+ pub fn rustc_pull ( & self , upstream_repo : String ) -> Result < PullResult , RustcPullError > {
3939 // The upstream commit that we want to pull
4040 let upstream_sha = {
4141 let out = run_command ( [
4242 "git" ,
4343 "ls-remote" ,
44- & format ! ( "https://github.com/{UPSTREAM_REPO }" ) ,
44+ & format ! ( "https://github.com/{upstream_repo }" ) ,
4545 "HEAD" ,
4646 ] )
4747 . context ( "cannot fetch upstream commit" ) ?;
@@ -59,7 +59,7 @@ impl GitSync {
5959 . start ( & self . context . config )
6060 . context ( "cannot start josh-proxy" ) ?;
6161 let josh_url = josh. git_url (
62- UPSTREAM_REPO ,
62+ & upstream_repo ,
6363 Some ( & upstream_sha) ,
6464 & self . context . config . construct_josh_filter ( ) ,
6565 ) ;
@@ -98,7 +98,7 @@ impl GitSync {
9898 } ) ?;
9999
100100 let prep_message = format ! (
101- r#"Prepare for merging from {UPSTREAM_REPO }
101+ r#"Prepare for merging from {upstream_repo }
102102
103103This updates the rust-version file to {upstream_sha}."# ,
104104 ) ;
@@ -144,9 +144,9 @@ This updates the rust-version file to {upstream_sha}."#,
144144 println ! ( "incoming ref: {incoming_ref}" ) ;
145145
146146 let merge_message = format ! (
147- r#"Merge ref '{upstream_head_short}' from {UPSTREAM_REPO }
147+ r#"Merge ref '{upstream_head_short}' from {upstream_repo }
148148
149- Pull recent changes from https://github.com/{UPSTREAM_REPO } via Josh.
149+ Pull recent changes from https://github.com/{upstream_repo } via Josh.
150150
151151Upstream ref: {upstream_sha}
152152Filtered ref: {incoming_ref}
@@ -241,7 +241,7 @@ This merge was created using https://github.com/rust-lang/josh-sync.
241241 & [
242242 "git" ,
243243 "fetch" ,
244- & format ! ( "https://github.com/{UPSTREAM_REPO }" ) ,
244+ & format ! ( "https://github.com/{DEFAULT_UPSTREAM_REPO }" ) ,
245245 & base_upstream_sha,
246246 ] ,
247247 & rustc_git,
0 commit comments