Skip to content

Commit 9806699

Browse files
committed
Add comment to git add usage
1 parent 625e983 commit 9806699

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/sync.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,18 @@ impl GitSync {
9999
This updates the rust-version file to {upstream_sha}."#,
100100
);
101101

102-
let config_path = self
102+
let rust_version_path = self
103103
.context
104104
.last_upstream_sha_path
105105
.to_string_lossy()
106106
.to_string();
107-
run_command(&["git", "add", &config_path])?;
107+
// Add the file to git index, in case this is the first time we perform the sync
108+
// Otherwise `git commit <file>` below wouldn't work.
109+
run_command(&["git", "add", &rust_version_path])?;
108110
run_command(&[
109111
"git",
110112
"commit",
111-
&config_path,
113+
&rust_version_path,
112114
"--no-verify",
113115
"-m",
114116
&prep_message,

0 commit comments

Comments
 (0)