X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=apply.c;h=179b3bbd00fc6da726491639920ba6540c9b3c71;hb=1b371f567d9b0094918e128262577b76994eef74;hp=9deb206faa5259e4f4f0a458ddc14dd4762da10b;hpb=70e1cca3886b2efac5bcd42065bde45395dd92c7;p=git.git diff --git a/apply.c b/apply.c index 9deb206f..179b3bbd 100644 --- a/apply.c +++ b/apply.c @@ -32,7 +32,7 @@ static int no_add = 0; static int show_index_info = 0; static int line_termination = '\n'; static const char apply_usage[] = -"git-apply [--stat] [--numstat] [--summary] [--check] [--index] [--apply] [--no-add] [--index-info] [--allow-binary-replacement] [-z] [-pNUM] ..."; +"git-apply [--stat] [--numstat] [--summary] [--check] [--index] [--apply] [--no-add] [--index-info] [--allow-binary-replacement] [-z] [-pNUM] [--whitespace=] ..."; static enum whitespace_eol { nowarn_whitespace, @@ -651,7 +651,7 @@ static int parse_git_header(char *line, int len, unsigned int size, struct patch len = linelen(line, size); if (!len || line[len-1] != '\n') break; - for (i = 0; i < sizeof(optable) / sizeof(optable[0]); i++) { + for (i = 0; i < ARRAY_SIZE(optable); i++) { const struct opentry *p = optable + i; int oplen = strlen(p->str); if (len < oplen || memcmp(p->str, line, oplen)) @@ -1402,7 +1402,8 @@ static int check_patch(struct patch *patch) costate.not_new = 0; costate.refresh_cache = 1; if (checkout_entry(active_cache[pos], - &costate) || + &costate, + NULL) || lstat(old_name, &st)) return -1; }