summaryrefslogtreecommitdiff
path: root/builtin/checkout.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-06-06 11:23:04 -0700
committerJunio C Hamano <gitster@pobox.com>2014-06-06 11:23:04 -0700
commitf7f349e1383077fb9e1c03335a372b52a19ab2f0 (patch)
treeaf7577da1619d7d056b967f480c1c371d666488b /builtin/checkout.c
parent43eb7cb260cb17e28dda12e8dc1eb5554e650841 (diff)
parent482b8f3208e797f00db58edd7ff0d67275e898f5 (diff)
downloadgit-f7f349e1383077fb9e1c03335a372b52a19ab2f0.tar.gz
Merge branch 'rs/reflog-exists'
* rs/reflog-exists: checkout.c: use ref_exists instead of file_exist refs.c: add new functions reflog_exists and delete_reflog
Diffstat (limited to 'builtin/checkout.c')
-rw-r--r--builtin/checkout.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index ff4492162d..f1dc56e55f 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -651,12 +651,8 @@ 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];
-
- 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 (!ref_exists(old->path) && reflog_exists(old->path))
+ delete_reflog(old->path);
}
}
remove_branch_state();