-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
22 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -186,7 +186,25 @@ impl TestContext { | |
.success(); | ||
} | ||
|
||
/// Run `git add` in the temporary directory. | ||
/// Configure git user and email. | ||
pub fn configure_git_author(&self) { | ||
Command::new("git") | ||
.arg("config") | ||
.arg("user.name") | ||
.arg("Pre-Commit Test") | ||
.current_dir(&self.temp_dir) | ||
.assert() | ||
.success(); | ||
Command::new("git") | ||
.arg("config") | ||
.arg("user.email") | ||
.arg("[email protected]") | ||
.current_dir(&self.temp_dir) | ||
.assert() | ||
.success(); | ||
} | ||
|
||
/// Run `git add`. | ||
pub fn git_add(&self, path: impl AsRef<OsStr>) { | ||
Command::new("git") | ||
.arg("add") | ||
|
@@ -196,7 +214,7 @@ impl TestContext { | |
.success(); | ||
} | ||
|
||
/// Run `git commit` in the temporary directory. | ||
/// Run `git commit`. | ||
pub fn git_commit(&self, message: &str) { | ||
Command::new("git") | ||
.arg("commit") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters