summaryrefslogtreecommitdiff
path: root/server/common
diff options
context:
space:
mode:
Diffstat (limited to 'server/common')
-rw-r--r--server/common/src/git.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/common/src/git.rs b/server/common/src/git.rs
index 37995b3..07c7e32 100644
--- a/server/common/src/git.rs
+++ b/server/common/src/git.rs
@@ -160,9 +160,9 @@ fn parse_tree_entries(output: String) -> Vec<TreeEntry> {
fn branch_eq(a: impl AsRef<str>, b: impl AsRef<str>) -> bool {
let a = a.as_ref();
let b = b.as_ref();
- if a.starts_with("refs/heads/") {
- if b.starts_with("refs/heads/") {
- return a[11..] == b[11..];
+ if let Some(stripped_a) = a.strip_prefix("refs/heads/") {
+ if let Some(stripped_b) = b.strip_prefix("refs/heads/") {
+ return stripped_a == stripped_b;
}
return a == format!("refs/heads/{b}");
} else {