sim: use 'git rev-parse --show-toplevel' for getting base dir

This commit is contained in:
Jussi Saurio
2025-08-20 09:58:21 +03:00
parent d456db31db
commit e6adb8992b

View File

@@ -463,15 +463,13 @@ impl BugBase {
Ok(PathBuf::from(
String::from_utf8(
Command::new("git")
.args(["rev-parse", "--git-dir"])
.args(["rev-parse", "--show-toplevel"])
.output()
.with_context(|| "should be able to get the git path")?
.stdout,
)
.with_context(|| "commit hash should be valid utf8")?
.trim()
.strip_suffix(".git")
.with_context(|| "should be able to strip .git suffix")?,
.trim(),
))
}
}