Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
repack_without_refs(): add a files_ref_store argument
author
Michael Haggerty
<mhagger@alum.mit.edu>
Sun, 4 Sep 2016 16:08:30 +0000
(18:08 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Fri, 9 Sep 2016 22:28:13 +0000
(15:28 -0700)
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs/files-backend.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
bd427cf
)
diff --git
a/refs/files-backend.c
b/refs/files-backend.c
index af3ad83fe59847623fe422f3123a67ec17b30843..af711f6f3d6c9b46387a88d21e0be70beb9ccdcd 100644
(file)
--- a/
refs/files-backend.c
+++ b/
refs/files-backend.c
@@
-2384,14
+2384,14
@@
static int files_pack_refs(struct ref_store *ref_store, unsigned int flags)
*
* The refs in 'refnames' needn't be sorted. `err` must not be NULL.
*/
*
* The refs in 'refnames' needn't be sorted. `err` must not be NULL.
*/
-static int repack_without_refs(struct string_list *refnames, struct strbuf *err)
+static int repack_without_refs(struct files_ref_store *refs,
+ struct string_list *refnames, struct strbuf *err)
{
{
- struct files_ref_store *refs =
- get_files_ref_store(NULL, "repack_without_refs");
struct ref_dir *packed;
struct string_list_item *refname;
int ret, needs_repacking = 0, removed = 0;
struct ref_dir *packed;
struct string_list_item *refname;
int ret, needs_repacking = 0, removed = 0;
+ assert_main_repository(&refs->base, "repack_without_refs");
assert(err);
/* Look for a packed ref */
assert(err);
/* Look for a packed ref */
@@
-2453,13
+2453,15
@@
static int delete_ref_loose(struct ref_lock *lock, int flag, struct strbuf *err)
int delete_refs(struct string_list *refnames, unsigned int flags)
{
int delete_refs(struct string_list *refnames, unsigned int flags)
{
+ struct files_ref_store *refs =
+ get_files_ref_store(NULL, "delete_refs");
struct strbuf err = STRBUF_INIT;
int i, result = 0;
if (!refnames->nr)
return 0;
struct strbuf err = STRBUF_INIT;
int i, result = 0;
if (!refnames->nr)
return 0;
- result = repack_without_refs(refnames, &err);
+ result = repack_without_refs(ref
s, ref
names, &err);
if (result) {
/*
* If we failed to rewrite the packed-refs file, then
if (result) {
/*
* If we failed to rewrite the packed-refs file, then
@@
-3769,7
+3771,7
@@
static int files_transaction_commit(struct ref_store *ref_store,
}
}
}
}
- if (repack_without_refs(&refs_to_delete, err)) {
+ if (repack_without_refs(
refs,
&refs_to_delete, err)) {
ret = TRANSACTION_GENERIC_ERROR;
goto cleanup;
}
ret = TRANSACTION_GENERIC_ERROR;
goto cleanup;
}