path: root/strbuf.c
diff options
authorAvery Pennarun <>2009-11-26 02:23:55 (GMT)
committerJunio C Hamano <>2010-01-18 06:45:06 (GMT)
commit8cc5b29065e19267cbc08b39c34674b02c2e3d59 (patch)
treea7fc209fac5df7d2a9c9a5795fb4f58746ae3840 /strbuf.c
parent73eb40eeaaebc5ebae283c06286b96b4aea00143 (diff)
git merge -X<option>
Teach "-X <option>" command line argument to "git merge" that is passed to strategy implementations. "ours" and "theirs" autoresolution introduced by the previous commit can be asked to the recursive strategy. Signed-off-by: Avery Pennarun <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'strbuf.c')
1 files changed, 9 insertions, 0 deletions
diff --git a/strbuf.c b/strbuf.c
index a6153dc..d71a623 100644
--- a/strbuf.c
+++ b/strbuf.c
@@ -10,6 +10,15 @@ int prefixcmp(const char *str, const char *prefix)
return (unsigned char)*prefix - (unsigned char)*str;
+int suffixcmp(const char *str, const char *suffix)
+ int len = strlen(str), suflen = strlen(suffix);
+ if (len < suflen)
+ return -1;
+ else
+ return strcmp(str + len - suflen, suffix);
* Used as the default ->buf value, so that people can always assume
* buf is non NULL and ->buf is NUL terminated even for a freshly