Skip to content

Commit 1fef4b5

Browse files
mhaggergitster
authored andcommitted
try_merge_strategy(): remove redundant lock_file allocation
By the time the "if" block is entered, the lock_file instance from the main function block is no longer in use, so re-use that one instead of allocating a second one. Note that the "lock" variable in the "if" block shadowed the "lock" variable at function scope, so the only change needed is to remove the inner definition. Signed-off-by: Michael Haggerty <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2091c50 commit 1fef4b5

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

builtin/merge.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,6 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,
668668
if (!strcmp(strategy, "recursive") || !strcmp(strategy, "subtree")) {
669669
int clean, x;
670670
struct commit *result;
671-
struct lock_file *lock = xcalloc(1, sizeof(struct lock_file));
672671
struct commit_list *reversed = NULL;
673672
struct merge_options o;
674673
struct commit_list *j;

0 commit comments

Comments
 (0)