Attribute world commits to conversations and restore temporary directories

This commit is contained in:
2026-11-08 03:15:15 +00:00
parent de351919dd
commit 62283e7733
6 changed files with 86 additions and 2 deletions
+31
View File
@@ -125,6 +125,37 @@ async fn run(fixture: &Fixture, script: &str) -> String {
assert_eq!(code, 0, "{}", String::from_utf8_lossy(&output));
String::from_utf8(output).unwrap()
}
#[tokio::test(flavor = "current_thread")]
async fn conversation_bash_commit_inherits_nearest_attribution() {
let fixture = fixture();
let mut options = options();
options.conversations = vec!["158".into(), "79".into()];
options
.env
.push(("SAUSAGE_CONVERSATION".into(), "wrong".into()));
let mut output = Vec::new();
let code = fixture
.runtime
.exec(
Command::Shell("sh -c 'git commit --allow-empty --no-gpg-sign -m attributed'".into()),
options,
&mut |_, bytes| output.extend_from_slice(bytes),
)
.await
.unwrap();
assert_eq!(code, 0, "{}", String::from_utf8_lossy(&output));
let commit = std::process::Command::new("git")
.args(["log", "worker", "-1", "--format=%B"])
.current_dir(fixture._temp.path().join("world/src/demo"))
.output()
.unwrap();
assert!(commit.status.success());
let text = String::from_utf8(commit.stdout).unwrap();
assert!(text.contains("Sausage-Conversation: 158"), "{text}");
assert!(!text.contains("Sausage-Conversation: 79"), "{text}");
assert!(!text.contains("Sausage-Conversation: wrong"), "{text}");
}
async fn edit(fixture: &Fixture) {
let file = fixture
.root