Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2019-06-27 12:28:51 +0300
committerJunio C Hamano <gitster@pobox.com>2019-06-27 22:45:17 +0300
commit90d3405196cfe5d3c63185a33dcee57fb6ea7e8a (patch)
tree29d7599bc8c7f952fd31214d59b9b30c5ee82857 /match-trees.c
parent0dd1f0c3a60161db7908472eff43e948711ce9bd (diff)
match-trees.c: remove the_repo from shift_tree*()
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'match-trees.c')
-rw-r--r--match-trees.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/match-trees.c b/match-trees.c
index de7e8a6783..f6c194c1cc 100644
--- a/match-trees.c
+++ b/match-trees.c
@@ -248,7 +248,8 @@ static int splice_tree(const struct object_id *oid1, const char *prefix,
* other hand, it could cover tree one and we might need to pick a
* subtree of it.
*/
-void shift_tree(const struct object_id *hash1,
+void shift_tree(struct repository *r,
+ const struct object_id *hash1,
const struct object_id *hash2,
struct object_id *shifted,
int depth_limit)
@@ -290,7 +291,7 @@ void shift_tree(const struct object_id *hash1,
if (!*del_prefix)
return;
- if (get_tree_entry(the_repository, hash2, del_prefix, shifted, &mode))
+ if (get_tree_entry(r, hash2, del_prefix, shifted, &mode))
die("cannot find path %s in tree %s",
del_prefix, oid_to_hex(hash2));
return;
@@ -307,7 +308,8 @@ void shift_tree(const struct object_id *hash1,
* Unfortunately we cannot fundamentally tell which one to
* be prefixed, as recursive merge can work in either direction.
*/
-void shift_tree_by(const struct object_id *hash1,
+void shift_tree_by(struct repository *r,
+ const struct object_id *hash1,
const struct object_id *hash2,
struct object_id *shifted,
const char *shift_prefix)
@@ -317,12 +319,12 @@ void shift_tree_by(const struct object_id *hash1,
unsigned candidate = 0;
/* Can hash2 be a tree at shift_prefix in tree hash1? */
- if (!get_tree_entry(the_repository, hash1, shift_prefix, &sub1, &mode1) &&
+ if (!get_tree_entry(r, hash1, shift_prefix, &sub1, &mode1) &&
S_ISDIR(mode1))
candidate |= 1;
/* Can hash1 be a tree at shift_prefix in tree hash2? */
- if (!get_tree_entry(the_repository, hash2, shift_prefix, &sub2, &mode2) &&
+ if (!get_tree_entry(r, hash2, shift_prefix, &sub2, &mode2) &&
S_ISDIR(mode2))
candidate |= 2;