summaryrefslogtreecommitdiff
path: root/refs.h
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2014-11-25 08:02:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-11-25 18:09:58 (GMT)
commit4a45b2f347245d321bf5c07fbe3f8091d122732f (patch)
tree31d312133a1e3477343face2db8bf865e9f379f3 /refs.h
parent6d6d06c9012e96d74e9ea7aeeb6ce6dcd1a11b0f (diff)
downloadgit-4a45b2f347245d321bf5c07fbe3f8091d122732f.zip
git-4a45b2f347245d321bf5c07fbe3f8091d122732f.tar.gz
git-4a45b2f347245d321bf5c07fbe3f8091d122732f.tar.bz2
repack_without_refs(): make the refnames argument a string_list
Most of the callers have string_lists available already, whereas two of them had to read data out of a string_list into an array of strings just to call this function. So change repack_without_refs() to take the list of refnames to omit as a string_list, and change the callers accordingly. Suggested-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.h')
-rw-r--r--refs.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/refs.h b/refs.h
index 2bc3556..405c657 100644
--- a/refs.h
+++ b/refs.h
@@ -163,7 +163,15 @@ extern void rollback_packed_refs(void);
*/
int pack_refs(unsigned int flags);
-extern int repack_without_refs(const char **refnames, int n,
+/*
+ * Rewrite the packed-refs file, omitting any refs listed in
+ * 'refnames'. On error, packed-refs will be unchanged, the return
+ * value is nonzero, and a message about the error is written to the
+ * 'err' strbuf.
+ *
+ * The refs in 'refnames' needn't be sorted. `err` must not be NULL.
+ */
+extern int repack_without_refs(struct string_list *refnames,
struct strbuf *err);
extern int ref_exists(const char *);