Skip to content

Commit 06893cf

Browse files
committed
Add full-name workaround as example (#251)
1 parent d986d09 commit 06893cf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

git-repository/tests/easy/reference.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,18 @@ mod find {
3535
fn to_partial_name(&self) -> String {
3636
format!("{}/{}", self.remote, self.branch)
3737
}
38+
fn to_full_name(&self) -> git_ref::FullName {
39+
format!("{}/{}", self.remote, self.branch)
40+
.try_into()
41+
.expect("always valid")
42+
}
3843
}
3944
let name = CustomName {
4045
remote: "origin",
4146
branch: "main",
4247
};
4348
repo.find_reference(&name.to_partial_name())?;
49+
repo.find_reference(name.to_full_name().to_partial())?;
4450

4551
Ok(())
4652
}

0 commit comments

Comments
 (0)