Skip to content

Commit

Permalink
hyperlink commit hashes of length 7 as well
Browse files Browse the repository at this point in the history
  • Loading branch information
th1000s committed Dec 9, 2024
1 parent 440cdd3 commit ef3e1be
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/features/hyperlinks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ pub fn remote_from_config(cfg: &Option<&GitConfig>) -> Option<GitRemoteRepo> {
}

lazy_static! {
// note: pure numbers are filtered out later again
static ref COMMIT_HASH_REGEX: Regex = Regex::new(r"\b[0-9a-f]{8,40}\b").unwrap();
// Commit hashes can be abbreviated to 7 characters, these necessarily become longer
// when more objects are in a repository.
// Note: pure numbers are filtered out later again.
static ref COMMIT_HASH_REGEX: Regex = Regex::new(r"\b[0-9a-f]{7,40}\b").unwrap();
}

pub fn format_commit_line_with_osc8_commit_hyperlink<'a>(
Expand Down

0 comments on commit ef3e1be

Please sign in to comment.