File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,11 @@ enum Command {
4141 /// By default, josh-sync will pull from rustc's HEAD (latest commit).
4242 #[ clap( long) ]
4343 upstream_commit : Option < String > ,
44+
45+ /// By default, the `pull` command will exit with status code 2 if there is nothing to pull.
46+ /// If you instead want to exit successfully in that case, pass this flag.
47+ #[ clap( long) ]
48+ allow_noop : bool ,
4449 } ,
4550 /// Push changes into the main `rust-lang/rust` repository `branch` of a `rustc` fork under
4651 /// the given GitHub `username`.
@@ -90,6 +95,7 @@ fn main() -> anyhow::Result<()> {
9095 rust_version_path,
9196 upstream_repo,
9297 upstream_commit,
98+ allow_noop,
9399 } => {
94100 let ctx = load_context ( & config_path, & rust_version_path) ?;
95101 let josh = get_josh_proxy ( ) ?;
@@ -109,7 +115,9 @@ fn main() -> anyhow::Result<()> {
109115 }
110116 Err ( RustcPullError :: NothingToPull ) => {
111117 eprintln ! ( "Nothing to pull" ) ;
112- std:: process:: exit ( 2 ) ;
118+ if !allow_noop {
119+ std:: process:: exit ( 2 ) ;
120+ }
113121 }
114122 Err ( RustcPullError :: PullFailed ( error) ) => {
115123 eprintln ! ( "Pull failure: {error:?}" ) ;
You can’t perform that action at this time.
0 commit comments