Skip to content

Commit cba595b

Browse files
peffgitster
authored andcommitted
drop casts from users EMPTY_TREE_SHA1_BIN
This macro already evaluates to the correct type, as it casts the string literal to "unsigned char *" itself (and callers who want the literal can use the _LITERAL form). Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 498a04a commit cba595b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

builtin/diff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
327327
add_head_to_pending(&rev);
328328
if (!rev.pending.nr) {
329329
struct tree *tree;
330-
tree = lookup_tree((const unsigned char*)EMPTY_TREE_SHA1_BIN);
330+
tree = lookup_tree(EMPTY_TREE_SHA1_BIN);
331331
add_pending_object(&rev, &tree->object, "HEAD");
332332
}
333333
break;

merge-recursive.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1914,7 +1914,7 @@ int merge_recursive(struct merge_options *o,
19141914
/* if there is no common ancestor, use an empty tree */
19151915
struct tree *tree;
19161916

1917-
tree = lookup_tree((const unsigned char *)EMPTY_TREE_SHA1_BIN);
1917+
tree = lookup_tree(EMPTY_TREE_SHA1_BIN);
19181918
merged_common_ancestors = make_virtual_commit(tree, "ancestor");
19191919
}
19201920

sequencer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ static void write_message(struct strbuf *msgbuf, const char *filename)
164164

165165
static struct tree *empty_tree(void)
166166
{
167-
return lookup_tree((const unsigned char *)EMPTY_TREE_SHA1_BIN);
167+
return lookup_tree(EMPTY_TREE_SHA1_BIN);
168168
}
169169

170170
static int error_dirty_index(struct replay_opts *opts)

0 commit comments

Comments
 (0)