mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-15 07:40:36 +08:00
cli/git: Remove dead code fn view_diff
This commit is contained in:
committed by
Fintan Halpenny
parent
86ea33b0ca
commit
fd93240b9d
@@ -351,28 +351,6 @@ pub fn parse_remote(refspec: &str) -> Option<(NodeId, &str)> {
|
||||
.and_then(|(peer, r)| NodeId::from_str(peer).ok().map(|p| (p, r)))
|
||||
}
|
||||
|
||||
pub fn view_diff(
|
||||
repo: &git2::Repository,
|
||||
left: &git2::Oid,
|
||||
right: &git2::Oid,
|
||||
) -> anyhow::Result<()> {
|
||||
// TODO(erikli): Replace with repo.diff()
|
||||
let workdir = repo
|
||||
.workdir()
|
||||
.ok_or_else(|| anyhow!("Could not get workdir current repository."))?;
|
||||
|
||||
let left = format!("{:.7}", left.to_string());
|
||||
let right = format!("{:.7}", right.to_string());
|
||||
|
||||
let mut git = Command::new("git")
|
||||
.current_dir(workdir)
|
||||
.args(["diff", &left, &right])
|
||||
.spawn()?;
|
||||
git.wait()?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn add_tag(
|
||||
repo: &git2::Repository,
|
||||
message: &str,
|
||||
|
||||
Reference in New Issue
Block a user