tree: convert parse_tree_indirect to struct object_id
Convert parse_tree_indirect to take a pointer to struct object_id. Update all the callers. This transformation was achieved using the following semantic patch and manual updates to the declaration and definition. Update builtin/checkout.c manually as well, since it uses a ternary expression not handled by the semantic patch. @@ expression E1; @@ - parse_tree_indirect(E1.hash) + parse_tree_indirect(&E1) @@ expression E1; @@ - parse_tree_indirect(E1->hash) + parse_tree_indirect(E1) Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
48be4c625b
commit
a9dbc17910
@ -369,7 +369,7 @@ static void parse_treeish_arg(const char **argv,
|
||||
archive_time = time(NULL);
|
||||
}
|
||||
|
||||
tree = parse_tree_indirect(oid.hash);
|
||||
tree = parse_tree_indirect(&oid);
|
||||
if (tree == NULL)
|
||||
die("not a tree object");
|
||||
|
||||
@ -383,7 +383,7 @@ static void parse_treeish_arg(const char **argv,
|
||||
if (err || !S_ISDIR(mode))
|
||||
die("current working directory is untracked");
|
||||
|
||||
tree = parse_tree_indirect(tree_oid.hash);
|
||||
tree = parse_tree_indirect(&tree_oid);
|
||||
}
|
||||
ar_args->tree = tree;
|
||||
ar_args->commit_sha1 = commit_sha1;
|
||||
|
Reference in New Issue
Block a user