Sync with v2.2.1
authorJunio C Hamano <gitster@pobox.com>
Thu, 18 Dec 2014 20:30:53 +0000 (12:30 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 18 Dec 2014 20:30:53 +0000 (12:30 -0800)
* maint:
Git 2.2.1
Git 2.1.4
Git 2.0.5
Git 1.9.5
Git 1.8.5.6
fsck: complain about NTFS ".git" aliases in trees
read-cache: optionally disallow NTFS .git variants
path: add is_ntfs_dotgit() helper
fsck: complain about HFS+ ".git" aliases in trees
read-cache: optionally disallow HFS+ .git variants
utf8: add is_hfs_dotgit() helper
fsck: notice .git case-insensitively
t1450: refactor ".", "..", and ".git" fsck tests
verify_dotfile(): reject .git case-insensitively
read-tree: add tests for confusing paths like ".." and ".git"
unpack-trees: propagate errors adding entries to the index

1  2 
Documentation/config.txt
Documentation/git.txt
config.c
unpack-trees.c
diff --combined Documentation/config.txt
index f615a5c35442ead9d8718f187c80f6a81289ebc9,302d61e76f6684733771e036fc5f1a42ea55f0fa..9335ff2ae29c532f82bbb18220a3a2ea3531b8b4
@@@ -246,6 -246,17 +246,17 @@@ core.precomposeunicode:
        When false, file names are handled fully transparent by Git,
        which is backward compatible with older versions of Git.
  
+ core.protectHFS::
+       If set to true, do not allow checkout of paths that would
+       be considered equivalent to `.git` on an HFS+ filesystem.
+       Defaults to `true` on Mac OS, and `false` elsewhere.
+ core.protectNTFS::
+       If set to true, do not allow checkout of paths that would
+       cause problems with the NTFS filesystem, e.g. conflict with
+       8.3 "short" names.
+       Defaults to `true` on Windows, and `false` elsewhere.
  core.trustctime::
        If false, the ctime differences between the index and the
        working tree are ignored; useful when the inode change time
@@@ -839,10 -850,6 +850,10 @@@ accepted are `normal`, `black`, `red`, 
  `blink` and `reverse`.  The first color given is the foreground; the
  second is the background.  The position of the attribute, if any,
  doesn't matter.
 ++
 +Colors (foreground and background) may also be given as numbers between
 +0 and 255; these use ANSI 256-color mode (but note that not all
 +terminals may support this).
  
  color.diff::
        Whether to use ANSI escape sequences to add color to patches.
diff --combined Documentation/git.txt
index dd172548f31011d1261c3c09323869596d4d6cb7,db4e407bb16a3233cc5c57c05f73ecee9b49b588..73dc0ad0a03607db45a4f6056d9cdac58dbeca5e
@@@ -43,40 -43,45 +43,45 @@@ unreleased) version of Git, that is ava
  branch of the `git.git` repository.
  Documentation for older releases are available here:
  
- * link:v2.2.0/git.html[documentation for release 2.2]
+ * link:v2.2.1/git.html[documentation for release 2.2.1]
  
  * release notes for
+   link:RelNotes/2.2.1.txt[2.2.1],
    link:RelNotes/2.2.0.txt[2.2].
  
- * link:v2.1.3/git.html[documentation for release 2.1.3]
+ * link:v2.1.4/git.html[documentation for release 2.1.4]
  
  * release notes for
+   link:RelNotes/2.1.4.txt[2.1.4],
    link:RelNotes/2.1.3.txt[2.1.3],
    link:RelNotes/2.1.2.txt[2.1.2],
    link:RelNotes/2.1.1.txt[2.1.1],
    link:RelNotes/2.1.0.txt[2.1].
  
- * link:v2.0.4/git.html[documentation for release 2.0.4]
+ * link:v2.0.5/git.html[documentation for release 2.0.5]
  
  * release notes for
+   link:RelNotes/2.0.5.txt[2.0.5],
    link:RelNotes/2.0.4.txt[2.0.4],
    link:RelNotes/2.0.3.txt[2.0.3],
    link:RelNotes/2.0.2.txt[2.0.2],
    link:RelNotes/2.0.1.txt[2.0.1],
    link:RelNotes/2.0.0.txt[2.0.0].
  
- * link:v1.9.4/git.html[documentation for release 1.9.4]
+ * link:v1.9.5/git.html[documentation for release 1.9.5]
  
  * release notes for
+   link:RelNotes/1.9.5.txt[1.9.5],
    link:RelNotes/1.9.4.txt[1.9.4],
    link:RelNotes/1.9.3.txt[1.9.3],
    link:RelNotes/1.9.2.txt[1.9.2],
    link:RelNotes/1.9.1.txt[1.9.1],
    link:RelNotes/1.9.0.txt[1.9.0].
  
- * link:v1.8.5.5/git.html[documentation for release 1.8.5.5]
+ * link:v1.8.5.6/git.html[documentation for release 1.8.5.6]
  
  * release notes for
+   link:RelNotes/1.8.5.6.txt[1.8.5.6],
    link:RelNotes/1.8.5.5.txt[1.8.5.5],
    link:RelNotes/1.8.5.4.txt[1.8.5.4],
    link:RelNotes/1.8.5.3.txt[1.8.5.3],
@@@ -881,21 -886,19 +886,21 @@@ othe
        and the `core.editor` option in linkgit:git-config[1].
  
  'GIT_SSH'::
 -      If this environment variable is set then 'git fetch'
 -      and 'git push' will use this command instead
 -      of 'ssh' when they need to connect to a remote system.
 -      The '$GIT_SSH' command will be given exactly two or
 -      four arguments: the 'username@host' (or just 'host')
 -      from the URL and the shell command to execute on that
 -      remote system, optionally preceded by '-p' (literally) and
 -      the 'port' from the URL when it specifies something other
 -      than the default SSH port.
 +'GIT_SSH_COMMAND'::
 +      If either of these environment variables is set then 'git fetch'
 +      and 'git push' will use the specified command instead of 'ssh'
 +      when they need to connect to a remote system.
 +      The command will be given exactly two or four arguments: the
 +      'username@host' (or just 'host') from the URL and the shell
 +      command to execute on that remote system, optionally preceded by
 +      '-p' (literally) and the 'port' from the URL when it specifies
 +      something other than the default SSH port.
  +
 -To pass options to the program that you want to list in GIT_SSH
 -you will need to wrap the program and options into a shell script,
 -then set GIT_SSH to refer to the shell script.
 +`$GIT_SSH_COMMAND` takes precedence over `$GIT_SSH`, and is interpreted
 +by the shell, which allows additional arguments to be included.
 +`$GIT_SSH` on the other hand must be just the path to a program
 +(which can be a wrapper shell script, if additional arguments are
 +needed).
  +
  Usually it is easier to configure any desired options through your
  personal `.ssh/config` file.  Please consult your ssh documentation
diff --combined config.c
index ae1398f4f486e65adbeb8e5b82513febf31e6dd2,d5446d2b631e0bc13e78d12fed2c63b0e29aae0a..752e2e227f56edfb7b2ad168798c110c14a2c5e8
+++ b/config.c
@@@ -506,9 -506,9 +506,9 @@@ static int git_parse_signed(const char 
                        errno = EINVAL;
                        return 0;
                }
 -              uval = abs(val);
 +              uval = labs(val);
                uval *= factor;
 -              if (uval > max || abs(val) > uval) {
 +              if (uval > max || labs(val) > uval) {
                        errno = ERANGE;
                        return 0;
                }
@@@ -896,6 -896,16 +896,16 @@@ static int git_default_core_config(cons
                return 0;
        }
  
+       if (!strcmp(var, "core.protecthfs")) {
+               protect_hfs = git_config_bool(var, value);
+               return 0;
+       }
+       if (!strcmp(var, "core.protectntfs")) {
+               protect_ntfs = git_config_bool(var, value);
+               return 0;
+       }
        /* Add other config variables here and to Documentation/config.txt. */
        return 0;
  }
diff --combined unpack-trees.c
index 3a66849e38b1940b1f3fc9c542ea864a86278687,256df47b3533bc085428d3fc5239173200a8e648..be84ba2607ad2dbdb17397869c459418abad78e4
@@@ -98,7 -98,7 +98,7 @@@ void setup_unpack_trees_porcelain(struc
                opts->unpack_rejects[i].strdup_strings = 1;
  }
  
- static void do_add_entry(struct unpack_trees_options *o, struct cache_entry *ce,
+ static int do_add_entry(struct unpack_trees_options *o, struct cache_entry *ce,
                         unsigned int set, unsigned int clear)
  {
        clear |= CE_HASHED;
                set |= CE_WT_REMOVE;
  
        ce->ce_flags = (ce->ce_flags & ~clear) | set;
-       add_index_entry(&o->result, ce,
-                       ADD_CACHE_OK_TO_ADD | ADD_CACHE_OK_TO_REPLACE);
+       return add_index_entry(&o->result, ce,
+                              ADD_CACHE_OK_TO_ADD | ADD_CACHE_OK_TO_REPLACE);
  }
  
  static struct cache_entry *dup_entry(const struct cache_entry *ce)
@@@ -609,7 -609,9 +609,9 @@@ static int unpack_nondirectories(int n
  
        for (i = 0; i < n; i++)
                if (src[i] && src[i] != o->df_conflict_entry)
-                       do_add_entry(o, src[i], 0, 0);
+                       if (do_add_entry(o, src[i], 0, 0))
+                               return -1;
        return 0;
  }
  
@@@ -1155,8 -1157,6 +1157,8 @@@ int unpack_trees(unsigned len, struct t
        if (o->dst_index) {
                discard_index(o->dst_index);
                *o->dst_index = o->result;
 +      } else {
 +              discard_index(&o->result);
        }
  
  done: