Merge branch 'bw/object-id'
Conversion from uchar[20] to struct object_id continues. * bw/object-id: (33 commits) diff: rename diff_fill_sha1_info to diff_fill_oid_info diffcore-rename: use is_empty_blob_oid tree-diff: convert path_appendnew to object_id tree-diff: convert diff_tree_paths to struct object_id tree-diff: convert try_to_follow_renames to struct object_id builtin/diff-tree: cleanup references to sha1 diff-tree: convert diff_tree_sha1 to struct object_id notes-merge: convert write_note_to_worktree to struct object_id notes-merge: convert verify_notes_filepair to struct object_id notes-merge: convert find_notes_merge_pair_ps to struct object_id notes-merge: convert merge_from_diffs to struct object_id notes-merge: convert notes_merge* to struct object_id tree-diff: convert diff_root_tree_sha1 to struct object_id combine-diff: convert find_paths_* to struct object_id combine-diff: convert diff_tree_combined to struct object_id diff: convert diff_flush_patch_id to struct object_id patch-ids: convert to struct object_id diff: finish conversion for prepare_temp_file to struct object_id diff: convert reuse_worktree_file to struct object_id diff: convert fill_filespec to struct object_id ...
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
|
||||
static struct rev_info log_tree_opt;
|
||||
|
||||
static int diff_tree_commit_sha1(const struct object_id *oid)
|
||||
static int diff_tree_commit_oid(const struct object_id *oid)
|
||||
{
|
||||
struct commit *commit = lookup_commit_reference(oid);
|
||||
if (!commit)
|
||||
@ -49,8 +49,8 @@ static int stdin_diff_trees(struct tree *tree1, const char *p)
|
||||
return -1;
|
||||
printf("%s %s\n", oid_to_hex(&tree1->object.oid),
|
||||
oid_to_hex(&tree2->object.oid));
|
||||
diff_tree_sha1(tree1->object.oid.hash, tree2->object.oid.hash,
|
||||
"", &log_tree_opt.diffopt);
|
||||
diff_tree_oid(&tree1->object.oid, &tree2->object.oid,
|
||||
"", &log_tree_opt.diffopt);
|
||||
log_tree_diff_flush(&log_tree_opt);
|
||||
return 0;
|
||||
}
|
||||
@ -98,7 +98,6 @@ static void diff_tree_tweak_rev(struct rev_info *rev, struct setup_revision_opt
|
||||
|
||||
int cmd_diff_tree(int argc, const char **argv, const char *prefix)
|
||||
{
|
||||
int nr_sha1;
|
||||
char line[1000];
|
||||
struct object *tree1, *tree2;
|
||||
static struct rev_info *opt = &log_tree_opt;
|
||||
@ -134,15 +133,14 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix)
|
||||
* second one is marked UNINTERESTING, we recover the original
|
||||
* order the user gave, i.e. "a..b", by swapping the trees.
|
||||
*/
|
||||
nr_sha1 = opt->pending.nr;
|
||||
switch (nr_sha1) {
|
||||
switch (opt->pending.nr) {
|
||||
case 0:
|
||||
if (!read_stdin)
|
||||
usage(diff_tree_usage);
|
||||
break;
|
||||
case 1:
|
||||
tree1 = opt->pending.objects[0].item;
|
||||
diff_tree_commit_sha1(&tree1->oid);
|
||||
diff_tree_commit_oid(&tree1->oid);
|
||||
break;
|
||||
case 2:
|
||||
tree1 = opt->pending.objects[0].item;
|
||||
@ -150,9 +148,7 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix)
|
||||
if (tree2->flags & UNINTERESTING) {
|
||||
SWAP(tree2, tree1);
|
||||
}
|
||||
diff_tree_sha1(tree1->oid.hash,
|
||||
tree2->oid.hash,
|
||||
"", &opt->diffopt);
|
||||
diff_tree_oid(&tree1->oid, &tree2->oid, "", &opt->diffopt);
|
||||
log_tree_diff_flush(opt);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user