fix: Pass --no-gpg-sign to git commit in tests (#1718)

Some users have commit.gpgSign set to true in their global git config,
causing tests which run `git commit` to fail if the configured
user.signingKey is not present (as is often the case with PGP smart
cards). Passing this flag overrides the global git configuration,
preventing git from attempting sign the specified commit. This change
has no effect on users who haven't set commit.gpgSign to true.
This commit is contained in:
Logan Magee
2020-10-03 02:22:19 -08:00
committed by GitHub
parent 0883ad78cf
commit 2693d125a8
2 changed files with 11 additions and 7 deletions
+4 -4
View File
@@ -813,7 +813,7 @@ mod tests {
.current_dir(&repo_dir.path())
.output()?;
Command::new("git")
.args(&["commit", "-m", "add new files"])
.args(&["commit", "-m", "add new files", "--no-gpg-sign"])
.current_dir(&repo_dir.path())
.output()?;
@@ -842,7 +842,7 @@ mod tests {
File::create(repo_dir.join("readme.md"))?.sync_all()?;
Command::new("git")
.args(&["commit", "-am", "Update readme"])
.args(&["commit", "-am", "Update readme", "--no-gpg-sign"])
.current_dir(&repo_dir)
.output()?;
barrier();
@@ -870,7 +870,7 @@ mod tests {
fs::write(repo_dir.join("Cargo.toml"), " ")?;
Command::new("git")
.args(&["commit", "-am", "Update readme"])
.args(&["commit", "-am", "Update readme", "--no-gpg-sign"])
.current_dir(repo_dir)
.output()?;
barrier();
@@ -894,7 +894,7 @@ mod tests {
barrier();
Command::new("git")
.args(&["commit", "-m", "Change readme"])
.args(&["commit", "-m", "Change readme", "--no-gpg-sign"])
.current_dir(repo_dir)
.output()?;
barrier();