Fix tip commit helper function
This commit is contained in:
parent
2566dc07fc
commit
e454558faa
@ -396,13 +396,7 @@ impl BenchmarkRepository
|
|||||||
fn tip_commit<'repository>(repository: &'repository git2::Repository, branch_name: &str) -> Result<git2::Commit<'repository>, git2::Error>
|
fn tip_commit<'repository>(repository: &'repository git2::Repository, branch_name: &str) -> Result<git2::Commit<'repository>, git2::Error>
|
||||||
{
|
{
|
||||||
let tip_reference_name = format!("refs/remotes/origin/{}", branch_name);
|
let tip_reference_name = format!("refs/remotes/origin/{}", branch_name);
|
||||||
let tip_reference = match repository.find_reference(&tip_reference_name)
|
repository.find_reference(&tip_reference_name).and_then(|tip_reference| tip_reference.peel_to_commit())
|
||||||
{
|
|
||||||
Ok(value) => value,
|
|
||||||
Err(error) => panic!("Could not find reference “{}”: {}", tip_reference_name, error),
|
|
||||||
};
|
|
||||||
|
|
||||||
tip_reference.peel_to_commit()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn join(&self)
|
pub fn join(&self)
|
||||||
|
Loading…
Reference in New Issue
Block a user