fix: adjust for gix 0.57.0

This commit is contained in:
Harsh Shandilya 2023-12-29 23:21:18 +05:30
parent 0706dc06b7
commit 1eb5b7ca01

View File

@ -1,6 +1,6 @@
use crate::model::PersistableRepo;
use anyhow::Context;
use gix::{sec::trust::DefaultForLevel, Repository, ThreadSafeRepository};
use gix::{remote::Direction, sec::trust::DefaultForLevel, Repository, ThreadSafeRepository};
use std::{
collections::HashMap,
fs,
@ -142,7 +142,7 @@ fn get_current_branch(repository: &Repository) -> Option<String> {
fn get_remote_for_branch(repository: &Repository, branch_name: Option<&str>) -> Option<String> {
let branch_name = branch_name?;
repository
.branch_remote_name(branch_name)
.branch_remote_name(branch_name, Direction::Fetch)
.map(|n| n.as_bstr().to_string())
}