We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a1db20e commit 4645429Copy full SHA for 4645429
src/main.rs
@@ -138,16 +138,14 @@ fn get_upstream<'a>(
138
}
139
};
140
141
- let result = Command::new("git")
142
- .args(&[
143
- "merge-base",
144
- head_branch.name().unwrap().unwrap(),
145
- &upstream.id().to_string(),
146
- ])
147
- .output()?
148
- .stdout;
149
- let oid = Oid::from_str(std::str::from_utf8(&result)?.trim())?;
150
- let commit = repo.find_object(oid, None).unwrap();
+ let mb = repo.merge_base(
+ head_branch
+ .get()
+ .target()
+ .expect("all branches should ahve a target"),
+ upstream.id(),
+ )?;
+ let commit = repo.find_object(mb, None).unwrap();
151
152
Ok(Some(commit))
153
0 commit comments