Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Turner <dturner@twopensource.com>2015-11-10 14:42:40 +0300
committerJeff King <peff@peff.net>2015-11-20 12:52:01 +0300
commit0845122c39c415fa50904ee94c6b60e4e722466b (patch)
tree7fcb6eb01d6f13d272f346079a1e57eb8cbe32f8 /refs/refs-internal.h
parent5f3c3a4e6f11dedad93d9f5bb2caa85c684db54a (diff)
refs: break out ref conflict checks
Create new function find_descendant_ref, to hold one of the ref conflict checks used in verify_refname_available. Multiple backends will need this function, so move it to the common code. Also move rename_ref_available to the common code, because alternate backends might need it and it has no files-backend-specific code. Signed-off-by: David Turner <dturner@twopensource.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Jeff King <peff@peff.net>
Diffstat (limited to 'refs/refs-internal.h')
-rw-r--r--refs/refs-internal.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/refs/refs-internal.h b/refs/refs-internal.h
index 7b6c8bcb74..c7dded35f4 100644
--- a/refs/refs-internal.h
+++ b/refs/refs-internal.h
@@ -181,4 +181,20 @@ int files_log_ref_write(const char *refname, const unsigned char *old_sha1,
const unsigned char *new_sha1, const char *msg,
int flags, struct strbuf *err);
+/*
+ * Check for entries in extras that are within the specified
+ * directory, where dirname is a reference directory name including
+ * the trailing slash (e.g., "refs/heads/foo/"). Ignore any
+ * conflicting references that are found in skip. If there is a
+ * conflicting reference, return its name.
+ *
+ * extras and skip must be sorted lists of reference names. Either one
+ * can be NULL, signifying the empty list.
+ */
+const char *find_descendant_ref(const char *dirname,
+ const struct string_list *extras,
+ const struct string_list *skip);
+
+int rename_ref_available(const char *oldname, const char *newname);
+
#endif /* REFS_REFS_INTERNAL_H */