X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=inline;f=refs.c;h=808f56bb27b6ece616f400154fe98c9cef12f8ba;hb=c34ec65567793d16119c28df6ebeecfe8eb3d9f5;hp=dd9c9ba3f6cb1b7e742adaee89cc406c44d77367;hpb=48ae73b11487e12f8f7198e18779e65500d4ca0c;p=git.git diff --git a/refs.c b/refs.c index dd9c9ba3f..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, @@ -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];