Merge branch 'bc/tree-walk-oid'
authorJunio C Hamano <gitster@pobox.com>
Tue, 29 Jan 2019 20:47:56 +0000 (12:47 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 29 Jan 2019 20:47:56 +0000 (12:47 -0800)
The code to walk tree objects has been taught that we may be
working with object names that are not computed with SHA-1.

* bc/tree-walk-oid:
  cache: make oidcpy always copy GIT_MAX_RAWSZ bytes
  tree-walk: store object_id in a separate member
  match-trees: use hashcpy to splice trees
  match-trees: compute buffer offset correctly when splicing
  tree-walk: copy object ID before use

13 files changed:
1  2 
builtin/grep.c
builtin/merge-tree.c
builtin/pack-objects.c
cache-tree.c
cache.h
list-objects.c
packfile.c
revision.c
tree-diff.c
tree-walk.c
tree-walk.h
tree.c
unpack-trees.c

diff --cc builtin/grep.c
Simple merge
Simple merge
Simple merge
diff --cc cache-tree.c
Simple merge
diff --cc cache.h
Simple merge
diff --cc list-objects.c
Simple merge
diff --cc packfile.c
Simple merge
diff --cc revision.c
Simple merge
diff --cc tree-diff.c
Simple merge
diff --cc tree-walk.c
Simple merge
diff --cc tree-walk.h
@@@ -1,12 -1,14 +1,12 @@@
  #ifndef TREE_WALK_H
  #define TREE_WALK_H
  
- struct index_state;
- struct strbuf;
+ #include "cache.h"
  
 -struct strbuf;
 -
  struct name_entry {
-       const struct object_id *oid;
+       struct object_id oid;
        const char *path;
+       int pathlen;
        unsigned int mode;
  };
  
diff --cc tree.c
--- 1/tree.c
--- 2/tree.c
+++ b/tree.c
@@@ -101,10 -99,10 +101,10 @@@ static int read_tree_1(struct repositor
                else if (S_ISGITLINK(entry.mode)) {
                        struct commit *commit;
  
-                       commit = lookup_commit(r, entry.oid);
 -                      commit = lookup_commit(the_repository, &entry.oid);
++                      commit = lookup_commit(r, &entry.oid);
                        if (!commit)
                                die("Commit %s in submodule path %s%s not found",
-                                   oid_to_hex(entry.oid),
+                                   oid_to_hex(&entry.oid),
                                    base->buf, entry.path);
  
                        if (parse_commit(commit))
diff --cc unpack-trees.c
Simple merge