Skip to content

Commit 315f49f

Browse files
bmwillgitster
authored andcommitted
builtin/diff-tree: cleanup references to sha1
Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 66f414f commit 315f49f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

builtin/diff-tree.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
static struct rev_info log_tree_opt;
99

10-
static int diff_tree_commit_sha1(const struct object_id *oid)
10+
static int diff_tree_commit_oid(const struct object_id *oid)
1111
{
1212
struct commit *commit = lookup_commit_reference(oid);
1313
if (!commit)
@@ -98,7 +98,6 @@ static void diff_tree_tweak_rev(struct rev_info *rev, struct setup_revision_opt
9898

9999
int cmd_diff_tree(int argc, const char **argv, const char *prefix)
100100
{
101-
int nr_sha1;
102101
char line[1000];
103102
struct object *tree1, *tree2;
104103
static struct rev_info *opt = &log_tree_opt;
@@ -132,15 +131,14 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix)
132131
* reverse the order of the objects if the second one
133132
* is marked UNINTERESTING.
134133
*/
135-
nr_sha1 = opt->pending.nr;
136-
switch (nr_sha1) {
134+
switch (opt->pending.nr) {
137135
case 0:
138136
if (!read_stdin)
139137
usage(diff_tree_usage);
140138
break;
141139
case 1:
142140
tree1 = opt->pending.objects[0].item;
143-
diff_tree_commit_sha1(&tree1->oid);
141+
diff_tree_commit_oid(&tree1->oid);
144142
break;
145143
case 2:
146144
tree1 = opt->pending.objects[0].item;

0 commit comments

Comments
 (0)