Skip to content

Commit d37dfec

Browse files
committed
Apply review comments
1 parent 35c6e3e commit d37dfec

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

josh-sync.example.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
org = "rust-lang"
12
repo = "stdarch"
2-
upstream_sha = "abcdef"
3+
path = "library/stdarch"
4+
last_upstream_sha = "abcdef"

src/sync.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,12 @@ impl GitSync {
7272
"previous upstream base: {:?}",
7373
self.config.config.last_upstream_sha
7474
);
75-
println!("current upstream base: {upstream_sha}");
75+
println!("new upstream base: {upstream_sha}");
7676
println!("original local HEAD: {orig_head}");
7777

78+
/// If the upstream SHA hasn't changed from the latest sync, there is nothing to pull
79+
/// We distinguish this situation for tools that might not want to consider this to
80+
/// be an error.
7881
if let Some(previous_base_commit) = self.config.config.last_upstream_sha.as_ref() {
7982
if *previous_base_commit == upstream_sha {
8083
return Err(RustcPullError::NothingToPull);
@@ -91,8 +94,8 @@ impl GitSync {
9194
config.write(&self.config.path)?;
9295

9396
let prep_message = format!(
94-
r#"Update the upstream Rust SHA to {upstream_sha}
95-
To prepare for merging from {UPSTREAM_REPO}"#,
97+
r#"Update the upstream Rust SHA to {upstream_sha}.
98+
To prepare for merging from {UPSTREAM_REPO}."#,
9699
);
97100

98101
let config_path = self.config.path.to_string_lossy().to_string();
@@ -166,7 +169,7 @@ Filtered ref: {incoming_ref}
166169

167170
git_reset.disarm();
168171

169-
// Check that the number of roots did not increase.
172+
// Check that the number of roots did not change.
170173
if num_roots()? != num_roots_before {
171174
return Err(anyhow::anyhow!(
172175
"Josh created a new root commit. This is probably not the history you want."

0 commit comments

Comments
 (0)