summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-12-13 21:28:54 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-12-13 21:28:54 (GMT)
commit721cc4314cb593e799213ad5f926a1e9fc5779b0 (patch)
treeffa71b39724a9eed8dc7c653cafb4e1211e7820d /builtin
parent95ec6b1b3393eb6e26da40c565520a8db9796e9f (diff)
parentc250e02e2c6de8c116f4320a48ce44bbdb43015c (diff)
downloadgit-721cc4314cb593e799213ad5f926a1e9fc5779b0.zip
git-721cc4314cb593e799213ad5f926a1e9fc5779b0.tar.gz
git-721cc4314cb593e799213ad5f926a1e9fc5779b0.tar.bz2
Merge branch 'bc/hash-algo'
An infrastructure to define what hash function is used in Git is introduced, and an effort to plumb that throughout various codepaths has been started. * bc/hash-algo: repository: fix a sparse 'using integer as NULL pointer' warning Switch empty tree and blob lookups to use hash abstraction Integrate hash algorithm support with repo setup Add structure representing hash algorithm setup: expose enumerated repo info
Diffstat (limited to 'builtin')
-rw-r--r--builtin/am.c2
-rw-r--r--builtin/checkout.c2
-rw-r--r--builtin/diff.c2
-rw-r--r--builtin/pull.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/builtin/am.c b/builtin/am.c
index 02853b3..3d98e52 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -1433,7 +1433,7 @@ static void write_index_patch(const struct am_state *state)
if (!get_oid_tree("HEAD", &head))
tree = lookup_tree(&head);
else
- tree = lookup_tree(&empty_tree_oid);
+ tree = lookup_tree(the_hash_algo->empty_tree);
fp = xfopen(am_path(state, "patch"), "w");
init_revisions(&rev_info, NULL);
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 3faae382..e1e157d 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -514,7 +514,7 @@ static int merge_working_tree(const struct checkout_opts *opts,
}
tree = parse_tree_indirect(old->commit ?
&old->commit->object.oid :
- &empty_tree_oid);
+ the_hash_algo->empty_tree);
init_tree_desc(&trees[0], tree->buffer, tree->size);
tree = parse_tree_indirect(&new->commit->object.oid);
init_tree_desc(&trees[1], tree->buffer, tree->size);
diff --git a/builtin/diff.c b/builtin/diff.c
index 9808d06..16bfb22 100644
--- a/builtin/diff.c
+++ b/builtin/diff.c
@@ -379,7 +379,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
add_head_to_pending(&rev);
if (!rev.pending.nr) {
struct tree *tree;
- tree = lookup_tree(&empty_tree_oid);
+ tree = lookup_tree(the_hash_algo->empty_tree);
add_pending_object(&rev, &tree->object, "HEAD");
}
break;
diff --git a/builtin/pull.c b/builtin/pull.c
index 166b777..511dbbe 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -557,7 +557,7 @@ static int pull_into_void(const struct object_id *merge_head,
* index/worktree changes that the user already made on the unborn
* branch.
*/
- if (checkout_fast_forward(&empty_tree_oid, merge_head, 0))
+ if (checkout_fast_forward(the_hash_algo->empty_tree, merge_head, 0))
return 1;
if (update_ref("initial pull", "HEAD", merge_head, curr_head, 0, UPDATE_REFS_DIE_ON_ERR))