Skip to content

Commit

Permalink
fix(release-helper): use correct ref for branch remote fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
ericswpark committed May 23, 2024
1 parent 14af91e commit a6973fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions release-helper/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ fn push() -> Result<(), git2::Error> {
repo.tag_lightweight(&version, &commit_obj, false)?;

let head_ref = repo.head()?.resolve()?;
let branch_name = head_ref.shorthand().ok_or_else(|| {
let branch_name = head_ref.name().ok_or_else(|| {
Error::from_str("Failed to get branch name")
})?;
let upstream_remote = repo.branch_upstream_remote(branch_name)?;
Expand All @@ -313,7 +313,7 @@ fn push() -> Result<(), git2::Error> {
let mut push_options = PushOptions::new();
push_options.remote_callbacks(callbacks);

remote.push(&[&format!("refs/heads/{}", branch_name)], Some(&mut push_options))?;
remote.push(&[&branch_name], Some(&mut push_options))?;
remote.push(&[&format!("refs/tags/{}", &version)], Some(&mut push_options))?;

Ok(())
Expand Down

0 comments on commit a6973fa

Please sign in to comment.