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 {
41
41
/// By default, josh-sync will pull from rustc's HEAD (latest commit).
42
42
#[ clap( long) ]
43
43
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 ,
44
49
} ,
45
50
/// Push changes into the main `rust-lang/rust` repository `branch` of a `rustc` fork under
46
51
/// the given GitHub `username`.
@@ -90,6 +95,7 @@ fn main() -> anyhow::Result<()> {
90
95
rust_version_path,
91
96
upstream_repo,
92
97
upstream_commit,
98
+ allow_noop,
93
99
} => {
94
100
let ctx = load_context ( & config_path, & rust_version_path) ?;
95
101
let josh = get_josh_proxy ( ) ?;
@@ -109,7 +115,9 @@ fn main() -> anyhow::Result<()> {
109
115
}
110
116
Err ( RustcPullError :: NothingToPull ) => {
111
117
eprintln ! ( "Nothing to pull" ) ;
112
- std:: process:: exit ( 2 ) ;
118
+ if !allow_noop {
119
+ std:: process:: exit ( 2 ) ;
120
+ }
113
121
}
114
122
Err ( RustcPullError :: PullFailed ( error) ) => {
115
123
eprintln ! ( "Pull failure: {error:?}" ) ;
You can’t perform that action at this time.
0 commit comments