From f00f9a518394ea91877566909ed91e42e9cbe5e3 Mon Sep 17 00:00:00 2001
From: Philip L. McMahon <philip.l.mcmahon@gmail.com>
Date: Sat, 04 Feb 2012 12:52:55 -0500
Subject: [PATCH] Add pre-commit hook which protects ref paths from non-FF updates or deletes unless the user is a member of an authorized team
---
src/com/gitblit/utils/StringUtils.java | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/com/gitblit/utils/StringUtils.java b/src/com/gitblit/utils/StringUtils.java
index 1e47899..fc0bf42 100644
--- a/src/com/gitblit/utils/StringUtils.java
+++ b/src/com/gitblit/utils/StringUtils.java
@@ -488,4 +488,11 @@
String bs = Integer.toHexString((int) (b * 256));
return "#" + rs + gs + bs;
}
+
+ public static String stripDotGit(String value) {
+ if (value.toLowerCase().endsWith(".git")) {
+ return value.substring(0, value.length() - 4);
+ }
+ return value;
+ }
}
\ No newline at end of file
--
Gitblit v1.9.1