diff options
Diffstat (limited to 'builtin/checkout.c')
-rw-r--r-- | builtin/checkout.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c index 07cf555309..d3fc3a8532 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -651,12 +651,11 @@ static void update_refs_for_switch(const struct checkout_opts *opts, } } if (old->path && old->name) { - char log_file[PATH_MAX], ref_file[PATH_MAX]; + char ref_file[PATH_MAX]; - git_snpath(log_file, sizeof(log_file), "logs/%s", old->path); git_snpath(ref_file, sizeof(ref_file), "%s", old->path); - if (!file_exists(ref_file) && file_exists(log_file)) - remove_path(log_file); + if (!file_exists(ref_file) && reflog_exists(old->path)) + delete_reflog(old->path); } } remove_branch_state(); |