branch.c: remove the_repository reference

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Nguyễn Thái Ngọc Duy
2018-11-10 06:49:00 +01:00
committed by Junio C Hamano
parent 69d2cfe6e8
commit 4edce1729a
7 changed files with 27 additions and 19 deletions

View File

@ -753,7 +753,8 @@ static void update_refs_for_switch(const struct checkout_opts *opts,
free(refname);
}
else
create_branch(opts->new_branch, new_branch_info->name,
create_branch(the_repository,
opts->new_branch, new_branch_info->name,
opts->new_branch_force ? 1 : 0,
opts->new_branch_force ? 1 : 0,
opts->new_branch_log,
@ -811,7 +812,7 @@ static void update_refs_for_switch(const struct checkout_opts *opts,
delete_reflog(old_branch_info->path);
}
}
remove_branch_state();
remove_branch_state(the_repository);
strbuf_release(&msg);
if (!opts->quiet &&
(new_branch_info->path || (!opts->force_detach && !strcmp(new_branch_info->name, "HEAD"))))