summaryrefslogtreecommitdiff
path: root/refs
diff options
context:
space:
mode:
authorLibravatar David Turner <dturner@twopensource.com>2016-09-04 18:08:08 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-09-09 15:28:12 -0700
commitff3a299c457cb159a83df8382ed76731e03db530 (patch)
treedd29f026ee445bc19f5c2b5525fa6b72fc599ab3 /refs
parentresolve_gitlink_ref(): eliminate temporary variable (diff)
downloadtgif-ff3a299c457cb159a83df8382ed76731e03db530.tar.xz
rename_ref_available(): add docstring
And improve the internal variable names. 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: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs')
-rw-r--r--refs/refs-internal.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/refs/refs-internal.h b/refs/refs-internal.h
index efe584701b..0206e2b959 100644
--- a/refs/refs-internal.h
+++ b/refs/refs-internal.h
@@ -240,7 +240,17 @@ 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);
+/*
+ * 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 rename_ref_available(const char *old_refname, const char *new_refname);
/* We allow "recursive" symbolic refs. Only within reason, though */
#define SYMREF_MAXDEPTH 5