Skip to content

Commit 185232f

Browse files
committed
set git email so test passes on Ubuntu container
1 parent 9822f70 commit 185232f

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/toolchain/driver.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ pub(crate) struct GitContext {
9898

9999
impl GitContext {
100100
pub(crate) fn from_dir(path: &PathBuf) -> Result<Self> {
101-
let commit = git_cmd(path, &["rev-parse", "HEAD"])?;
102-
let tree = git_cmd(path, &["rev-parse", "HEAD^{tree}"])?;
101+
let commit = git_cmd(path, &["rev-parse", "HEAD", "--"])?;
102+
let tree = git_cmd(path, &["rev-parse", "HEAD^{tree}", "--"])?;
103103
let source_uri = git_cmd(path, &["remote", "get-url", "origin"]).unwrap_or_default();
104104
Ok(Self {
105105
commit,
@@ -400,7 +400,18 @@ mod tests {
400400
.output()
401401
.unwrap();
402402
std::process::Command::new("git")
403-
.args(["commit", "--allow-empty", "-m", "init"])
403+
.args(["config", "user.email", "kettle-ci@lunal.dev"])
404+
.current_dir(tmp.path())
405+
.output()
406+
.unwrap();
407+
std::process::Command::new("git")
408+
.args([
409+
"commit",
410+
"--author='Kettle CI <kettle-ci@lunal.dev>'",
411+
"--allow-empty",
412+
"-m",
413+
"init",
414+
])
404415
.current_dir(tmp.path())
405416
.output()
406417
.unwrap();

0 commit comments

Comments
 (0)