]> git.ipfire.org Git - thirdparty/git.git/commitdiff
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
index eefd26bb6214916f7c451d97710b5ee443e52088,08d349c54ffa413347bbf7237c84371bda0878e1..a4ad28ea5e62926b3450a4c7b093c9aa811107cd
@@@ -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
index 0b5c84d0d79ff6e598d50c829df47c4dcce7d32c,7badea00094a98220b37874f60d1813abd42decb..9f0457c05acf1e4d7bd9f215dd3c710b3cb2df4f
--- 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