Merge branch 'jc/fix-tree-walk' (early part)
authorJunio C Hamano <gitster@pobox.com>
Sat, 21 Nov 2009 07:55:50 +0000 (23:55 -0800)
committerJunio C Hamano <gitster@pobox.com>
Sat, 21 Nov 2009 07:55:50 +0000 (23:55 -0800)
* 'jc/fix-tree-walk' (early part):
unpack_callback(): use unpack_failed() consistently
unpack-trees: typofix
diff-lib.c: fix misleading comments on oneway_diff()

1  2 
unpack-trees.c
diff --combined unpack-trees.c
index 157d5d001fe3014def96e3660df7ee5b1b98c275,c424bab4097818cf9e7910baaee98deaa7943cbc..dd5999c3562219b7993420b22257f4088ab82b8d
@@@ -277,6 -277,17 +277,17 @@@ static int unpack_nondirectories(int n
        return 0;
  }
  
+ static int unpack_failed(struct unpack_trees_options *o, const char *message)
+ {
+       discard_index(&o->result);
+       if (!o->gently) {
+               if (message)
+                       return error("%s", message);
+               return -1;
+       }
+       return -1;
+ }
  static int unpack_callback(int n, unsigned long mask, unsigned long dirmask, struct name_entry *names, struct traverse_info *info)
  {
        struct cache_entry *src[MAX_UNPACK_TREES + 1] = { NULL, };
                        int cmp = compare_entry(ce, info, p);
                        if (cmp < 0) {
                                if (unpack_index_entry(ce, o) < 0)
-                                       return -1;
+                                       return unpack_failed(o, NULL);
                                continue;
                        }
                        if (!cmp) {
        return mask;
  }
  
- static int unpack_failed(struct unpack_trees_options *o, const char *message)
- {
-       discard_index(&o->result);
-       if (!o->gently) {
-               if (message)
-                       return error("%s", message);
-               return -1;
-       }
-       return -1;
- }
  /*
   * N-way merge "len" trees.  Returns 0 on success, -1 on failure to manipulate the
   * resulting index, -2 on failure to reflect the changes to the work tree.
@@@ -617,7 -617,7 +617,7 @@@ static int verify_absent(struct cache_e
                         * found "foo/." in the working tree.
                         * This is tricky -- if we have modified
                         * files that are in "foo/" we would lose
-                        * it.
+                        * them.
                         */
                        ret = verify_clean_subdirectory(ce, action, o);
                        if (ret < 0)
@@@ -895,7 -895,7 +895,7 @@@ int threeway_merge(struct cache_entry *
   * Two-way merge.
   *
   * The rule is to "carry forward" what is in the index without losing
 - * information across a "fast forward", favoring a successful merge
 + * information across a "fast-forward", favoring a successful merge
   * over a merge failure when it makes sense.  For details of the
   * "carry forward" rule, please see <Documentation/git-read-tree.txt>.
   *