]> git.ipfire.org Git - thirdparty/git.git/blobdiff - refs/refs-internal.h
Merge branch 'ab/refs-errno-cleanup'
[thirdparty/git.git] / refs / refs-internal.h
index 12224742ede8f01d4f8d88ceaaa2e326413bf674..fb2c58ce3bf5e49491a6368b025b447d6bfc6c3b 100644 (file)
@@ -150,9 +150,9 @@ struct ref_update {
        const char refname[FLEX_ARRAY];
 };
 
-int refs_read_raw_ref(struct ref_store *ref_store,
-                     const char *refname, struct object_id *oid,
-                     struct strbuf *referent, unsigned int *type);
+int refs_read_raw_ref(struct ref_store *ref_store, const char *refname,
+                     struct object_id *oid, struct strbuf *referent,
+                     unsigned int *type, int *failure_errno);
 
 /*
  * Write an error to `err` and return a nonzero value iff the same
@@ -229,20 +229,6 @@ const char *find_descendant_ref(const char *dirname,
                                const struct string_list *extras,
                                const struct string_list *skip);
 
-/*
- * Check whether an attempt to rename old_refname to new_refname would
- * cause a D/F conflict with any existing reference (other than
- * possibly old_refname). If there would be a conflict, emit an error
- * message and return false; otherwise, return true.
- *
- * Note that this function is not safe against all races with other
- * processes (though rename_ref() catches some races that might get by
- * this check).
- */
-int refs_rename_ref_available(struct ref_store *refs,
-                             const char *old_refname,
-                             const char *new_refname);
-
 /* We allow "recursive" symbolic refs. Only within reason, though */
 #define SYMREF_MAXDEPTH 5
 
@@ -713,10 +699,12 @@ struct ref_store {
 };
 
 /*
- * Parse contents of a loose ref file.
+ * Parse contents of a loose ref file. *failure_errno maybe be set to EINVAL for
+ * invalid contents.
  */
 int parse_loose_ref_contents(const char *buf, struct object_id *oid,
-                            struct strbuf *referent, unsigned int *type);
+                            struct strbuf *referent, unsigned int *type,
+                            int *failure_errno);
 
 /*
  * Fill in the generic part of refs and add it to our collection of