From: Junio C Hamano Date: Fri, 23 Feb 2007 05:34:36 +0000 (-0800) Subject: Merge branches 'lt/crlf' and 'jc/apply-config' X-Git-Tag: v1.5.1-rc1~258 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ef1a5c2fa8bc67abea6cbacf975ea3260cd40fa3;p=git.git Merge branches 'lt/crlf' and 'jc/apply-config' * lt/crlf: Teach core.autocrlf to 'git apply' t0020: add test for auto-crlf Make AutoCRLF ternary variable. Lazy man's auto-CRLF * jc/apply-config: t4119: test autocomputing -p for traditional diff input. git-apply: guess correct -p value for non-git patches. git-apply: notice "diff --git" patch again Fix botched "leak fix" t4119: add test for traditional patch and different p_value apply: fix memory leak in prefix_one() git-apply: require -p when working in a subdirectory. git-apply: do not lose cwd when run from a subdirectory. Teach 'git apply' to look at $HOME/.gitconfig even outside of a repository Teach 'git apply' to look at $GIT_DIR/config --- ef1a5c2fa8bc67abea6cbacf975ea3260cd40fa3 diff --cc builtin-apply.c index d67817834,45c4acbd2,c7d4bdd47..630d8fd65 --- a/builtin-apply.c +++ b/builtin-apply.c @@@@ -2598,6 -2619,7 -2685,12 +2706,12 @@@@ int cmd_apply(int argc, const char **ar const char *whitespace_option = NULL; ++ prefix = setup_git_directory_gently(&is_not_gitdir); ++ prefix_length = prefix ? strlen(prefix) : 0; ++ git_config(git_apply_config); ++ if (apply_default_whitespace) ++ parse_whitespace_option(apply_default_whitespace); + for (i = 1; i < argc; i++) { const char *arg = argv[i]; char *end; @@@@ -2615,8 -2637,8 -2708,9 +2729,9 @@@@ excludes = x; continue; } -- if (!strncmp(arg, "-p", 2)) { ++ if (!prefixcmp(arg, "-p")) { p_value = atoi(arg + 2); ++ p_value_known = 1; continue; } if (!strcmp(arg, "--no-add")) {