We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bbe0f23 commit 8670280Copy full SHA for 8670280
src/worker/git.rs
@@ -66,16 +66,21 @@ pub fn sync_yanked(
66
})
67
.collect::<Result<Vec<_>, PerformError>>();
68
let new = new?.join("\n") + "\n";
69
- fs::write(&dst, new.as_bytes())?;
70
71
- let message: String = format!(
72
- "{} crate `{}#{}`",
73
- if yanked { "Yanking" } else { "Unyanking" },
74
- krate,
75
- version_num
76
- );
+ if new != prev {
+ fs::write(&dst, new.as_bytes())?;
77
78
- repo.commit_and_push(&message, &dst)?;
+ let message: String = format!(
+ "{} crate `{}#{}`",
+ if yanked { "Yanking" } else { "Unyanking" },
+ krate,
+ version_num
+ );
79
+
80
+ repo.commit_and_push(&message, &dst)?;
81
+ } else {
82
+ debug!("Skipping `yanked` update because index is up-to-date");
83
+ }
84
85
Ok(())
86
}
0 commit comments