X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=refs.c;h=808f56bb27b6ece616f400154fe98c9cef12f8ba;hb=28754ab5f0ce9b4f6ca1641c3e10e2c68bd9b3fc;hp=e49eaa3089c39028e3c0af90422672db63fff198;hpb=985d54008359db59a45462627884703aa7ce1ddb;p=git.git diff --git a/refs.c b/refs.c index e49eaa308..808f56bb2 100644 --- a/refs.c +++ b/refs.c @@ -668,6 +668,11 @@ int for_each_remote_ref(each_ref_fn fn, void *cb_data) return for_each_ref_in("refs/remotes/", fn, cb_data); } +int for_each_replace_ref(each_ref_fn fn, void *cb_data) +{ + return do_for_each_ref("refs/replace/", fn, 13, 0, cb_data); +} + int for_each_rawref(each_ref_fn fn, void *cb_data) { return do_for_each_ref("refs/", fn, 0, @@ -821,7 +826,7 @@ static int remove_empty_directories(const char *file) strbuf_init(&path, 20); strbuf_addstr(&path, file); - result = remove_dir_recursively(&path, 1); + result = remove_dir_recursively(&path, REMOVE_DIR_EMPTY_ONLY); strbuf_release(&path); @@ -967,8 +972,10 @@ static int repack_without_ref(const char *refname) if (!found) return 0; fd = hold_lock_file_for_update(&packlock, git_path("packed-refs"), 0); - if (fd < 0) + if (fd < 0) { + unable_to_lock_error(git_path("packed-refs"), errno); return error("cannot delete '%s' from packed refs", refname); + } for (list = packed_ref_list; list; list = list->next) { char line[PATH_MAX + 100];