path: root/builtin/merge.c
diff options
authorMichael Haggerty <>2014-10-01 10:28:29 (GMT)
committerJunio C Hamano <>2014-10-01 20:49:00 (GMT)
commit1fef4b5041e0144e476ffcc8c559bf06fa80340c (patch)
treefa5c24d9b573a6948c96af079ad850003006be20 /builtin/merge.c
parent2091c5062c6fd928e1ad3e7c059243e597cb8bbf (diff)
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 <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'builtin/merge.c')
1 files changed, 0 insertions, 1 deletions
diff --git a/builtin/merge.c b/builtin/merge.c
index dff043d..1ec3939 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -668,7 +668,6 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,
if (!strcmp(strategy, "recursive") || !strcmp(strategy, "subtree")) {
int clean, x;
struct commit *result;
- struct lock_file *lock = xcalloc(1, sizeof(struct lock_file));
struct commit_list *reversed = NULL;
struct merge_options o;
struct commit_list *j;