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
This commit is contained in:
Junio C Hamano
2014-06-06 11:23:04 -07:00
5 changed files with 32 additions and 13 deletions

View File

@ -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();