]> git.ipfire.org Git - thirdparty/git.git/blobdiff - refs.h
compat: convert modes to use portable file type values
[thirdparty/git.git] / refs.h
diff --git a/refs.h b/refs.h
index 163b45c50aa36b3438012836ded62993d06c73c6..ec46acdde7b67d3531a4c0e18d33901d2a4f307a 100644 (file)
--- a/refs.h
+++ b/refs.h
@@ -128,6 +128,8 @@ extern int repack_without_refs(const char **refnames, int n,
 
 extern int ref_exists(const char *);
 
+extern int is_branch(const char *refname);
+
 /*
  * If refname is a non-symbolic reference that refers to a tag object,
  * and the tag can be (recursively) dereferenced to a non-tag object,
@@ -246,12 +248,16 @@ struct ref_transaction *ref_transaction_begin(void);
  * be deleted.  If have_old is true, then old_sha1 holds the value
  * that the reference should have had before the update, or zeros if
  * it must not have existed beforehand.
+ * Function returns 0 on success and non-zero on failure. A failure to update
+ * means that the transaction as a whole has failed and will need to be
+ * rolled back. On failure the err buffer will be updated.
  */
-void ref_transaction_update(struct ref_transaction *transaction,
-                           const char *refname,
-                           const unsigned char *new_sha1,
-                           const unsigned char *old_sha1,
-                           int flags, int have_old);
+int ref_transaction_update(struct ref_transaction *transaction,
+                          const char *refname,
+                          const unsigned char *new_sha1,
+                          const unsigned char *old_sha1,
+                          int flags, int have_old,
+                          struct strbuf *err);
 
 /*
  * Add a reference creation to transaction.  new_sha1 is the value