Skip to content

Commit 3827998

Browse files
Update src/utils/vcs.rs
Co-authored-by: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com>
1 parent cb60ee3 commit 3827998

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/utils/vcs.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,9 @@ pub fn find_base_sha(remote_name: &str) -> Result<Option<String>> {
581581

582582
let repo = git2::Repository::open_from_env().context("Could not open repository")?;
583583

584-
let head_commit = repo.head()?.peel_to_commit()?;
584+
let head_commit = repo.head()
585+
.and_then(|h| h.peel_to_commit())
586+
.context("Could not find head commit")?;
585587

586588
let remote_branch_name = format!("refs/remotes/{remote_name}/HEAD");
587589
let remote_ref = repo

0 commit comments

Comments
 (0)