diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-01-20 20:28:50 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-01-20 20:28:50 -0800 |
commit | fcb2a7e4a3c7899a3432f5804889fa3ea5779220 (patch) | |
tree | 0f0785d427c23c7b8dbaae1afcdbd370ea3b639c /strbuf.c | |
parent | e98f80f50bf9b78aab8cea6184fd708259d0c3b3 (diff) | |
parent | 566c511195adc0ce88559853f2f00933e241d862 (diff) | |
download | git-fcb2a7e4a3c7899a3432f5804889fa3ea5779220.tar.gz |
Merge branch 'ap/merge-backend-opts'
* ap/merge-backend-opts:
Document that merge strategies can now take their own options
Extend merge-subtree tests to test -Xsubtree=dir.
Make "subtree" part more orthogonal to the rest of merge-recursive.
pull: Fix parsing of -X<option>
Teach git-pull to pass -X<option> to git-merge
git merge -X<option>
git-merge-file --ours, --theirs
Conflicts:
git-compat-util.h
Diffstat (limited to 'strbuf.c')
-rw-r--r-- | strbuf.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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 |