Skip to content

Commit

Permalink
fix(refs)!: remove Reference::Commit variant (XAMPPRocky#697)
Browse files Browse the repository at this point in the history
  • Loading branch information
benpueschel authored Sep 22, 2024
1 parent 3167540 commit a8bcee4
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,23 +481,18 @@ pub mod repos {
pub enum Reference {
Branch(String),
Tag(String),
Commit(String),
}

impl Reference {
pub fn ref_url(&self) -> String {
match self {
Self::Branch(branch) => format!("heads/{branch}"),
Self::Tag(tag) => format!("tags/{tag}"),
Self::Commit(sha) => sha.clone(),
}
}

pub fn full_ref_url(&self) -> String {
match self {
Self::Branch(_) | Self::Tag(_) => format!("refs/{}", self.ref_url()),
Self::Commit(sha) => sha.clone(),
}
format!("refs/{}", self.ref_url())
}
}

Expand Down

0 comments on commit a8bcee4

Please sign in to comment.