Code

Merge branches 'lt/crlf' and 'jc/apply-config'
authorJunio C Hamano <junkio@cox.net>
Fri, 23 Feb 2007 05:34:36 +0000 (21:34 -0800)
committerJunio C Hamano <junkio@cox.net>
Fri, 23 Feb 2007 05:34:36 +0000 (21:34 -0800)
* 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<n> for traditional diff input.
  git-apply: guess correct -p<n> 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<n> 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

1  2  3 
Makefile
builtin-apply.c
cache.h
config.c
diff.c
sha1_file.c

diff --cc Makefile
Simple merge
diff --cc builtin-apply.c
index d67817834bc33b864c569c597d96e55642c8ee61,45c4acbd205d02d0c6586b925909756b4508867c,c7d4bdd47451ca0b57c701f98129a019075611e9..630d8fd6521a63320e59a5bd061720d1fc841e7a
@@@@ -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;
                        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")) {
diff --cc cache.h
Simple merge
diff --cc config.c
Simple merge
diff --cc diff.c
Simple merge
diff --cc sha1_file.c
Simple merge