Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-06-06 22:23:04 +0400
committerJunio C Hamano <gitster@pobox.com>2014-06-06 22:23:04 +0400
commitf7f349e1383077fb9e1c03335a372b52a19ab2f0 (patch)
treeaf7577da1619d7d056b967f480c1c371d666488b /builtin
parent43eb7cb260cb17e28dda12e8dc1eb5554e650841 (diff)
parent482b8f3208e797f00db58edd7ff0d67275e898f5 (diff)
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')
-rw-r--r--builtin/checkout.c8
-rw-r--r--builtin/reflog.c2
2 files changed, 3 insertions, 7 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();
diff --git a/builtin/reflog.c b/builtin/reflog.c
index c12a9784e6..e8a8fb13b9 100644
--- a/builtin/reflog.c
+++ b/builtin/reflog.c
@@ -369,7 +369,7 @@ static int expire_reflog(const char *ref, const unsigned char *sha1, int unused,
if (!lock)
return error("cannot lock ref '%s'", ref);
log_file = git_pathdup("logs/%s", ref);
- if (!file_exists(log_file))
+ if (!reflog_exists(ref))
goto finish;
if (!cmd->dry_run) {
newlog_path = git_pathdup("logs/%s.lock", ref);