| |
|
| |
fn is_default_branch(repo_id: &RepoId, wanted: &str) -> bool {
|
| |
let res = get_default_branch(repo_id);
|
| - |
logger::debug2(format!("is_default_branch: res={res:?}"));
|
| |
if let Ok(actual) = res {
|
| - |
logger::debug2(format!(
|
| - |
"is_default_branch: actual={actual} wanted={wanted}"
|
| - |
));
|
| |
actual == wanted
|
| |
} else {
|
| - |
logger::debug("is_default_branch: could not get actual");
|
| |
false
|
| |
}
|
| |
}
|
| |
|
| |
fn get_default_branch(repo_id: &RepoId) -> Result<String, Box<dyn std::error::Error>> {
|
| |
let profile = Profile::load()?;
|
| - |
logger::debug("loaded profile");
|
| |
let path = profile.storage.path().join(repo_id.canonical());
|
| - |
logger::debug2(format!("path={}", path.display()));
|
| |
let repo = Repository::open(path, *repo_id)?;
|
| - |
logger::debug("loaded repo");
|
| |
let proj = repo.project()?;
|
| - |
logger::debug("loaded project");
|
| |
|
| |
let def = format!(
|
| |
"{}/refs/heads/{}",
|