remove target extraction from vbranch, use origin

This commit is contained in:
Kiril Videlov 2023-06-30 17:19:51 +02:00 committed by Kiril Videlov
parent 958979c623
commit f9bc13685a

View File

@ -1483,14 +1483,6 @@ pub fn push(
let current_session_reader = sessions::Reader::open(gb_repository, &current_session) let current_session_reader = sessions::Reader::open(gb_repository, &current_session)
.context("failed to open current session")?; .context("failed to open current session")?;
let target_reader = target::Reader::new(&current_session_reader);
let default_target = match target_reader.read_default() {
Ok(target) => Ok(target),
Err(reader::Error::NotFound) => return Ok(()),
Err(e) => Err(e),
}
.context("failed to read default target")?;
let branch_reader = branch::Reader::new(&current_session_reader); let branch_reader = branch::Reader::new(&current_session_reader);
let branch_writer = branch::Writer::new(gb_repository); let branch_writer = branch::Writer::new(gb_repository);
@ -1506,7 +1498,7 @@ pub fn push(
let output = Command::new("git") let output = Command::new("git")
.arg("push") .arg("push")
.arg(default_target.remote) .arg("origin")
.arg(format!("{}:{}", vbranch.head, upstream)) .arg(format!("{}:{}", vbranch.head, upstream))
.current_dir(project_path) .current_dir(project_path)
.output() .output()