Add prefixcmp()

We have too many strncmp(a, b, strlen(b)).

Signed-off-by: Junio C Hamano <junkio@cox.net>
diff --git a/git-compat-util.h b/git-compat-util.h
index 9863cf6..d027c36 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -279,4 +279,9 @@
 	return x;
 }
 
+static inline int prefixcmp(const char *str, const char *prefix)
+{
+	return strncmp(str, prefix, strlen(prefix));
+}
+
 #endif