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 <apenwarr@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Avery Pennarun
2009-11-25 21:23:55 -05:00
committed by Junio C Hamano
parent 73eb40eeaa
commit 8cc5b29065
11 changed files with 162 additions and 26 deletions

View File

@ -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