summaryrefslogtreecommitdiff
path: root/include/git2/refs.h
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2014-01-29 14:07:18 +0100
committerCarlos Martín Nieto <cmn@dwim.me>2014-02-05 12:07:56 +0100
commitfc4728e3e2a4094b202a63319232f25adbd55fed (patch)
treead320fc0824b3e924c529da0d9ef461b8be90672 /include/git2/refs.h
parent5d96fe8828505db852671175d5895dfd275f3d06 (diff)
downloadlibgit2-fc4728e3e2a4094b202a63319232f25adbd55fed.tar.gz
refs: return GIT_EMODIFIED if the ref target moved
In case we loose the race to update the reference, return GIT_EMODIFIED to let the user distinguish it from other types of errors.
Diffstat (limited to 'include/git2/refs.h')
-rw-r--r--include/git2/refs.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/git2/refs.h b/include/git2/refs.h
index 72622948b..aab8715fb 100644
--- a/include/git2/refs.h
+++ b/include/git2/refs.h
@@ -182,7 +182,8 @@ GIT_EXTERN(int) git_reference_create(git_reference **out, git_repository *repo,
* @param signature The identity that will used to populate the reflog entry
* @param log_message The one line long message to be appended to the reflog
* @param old_id The old value which the reference should have
- * @return 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code
+ * @return 0 on success, GIT_EMODIFIED if the value of the reference
+ * has changed, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code
*/
GIT_EXTERN(int) git_reference_create_matching(git_reference **out, git_repository *repo, const char *name, const git_oid *id, int force, const git_signature *signature, const char *log_message, const git_oid *old_id);
@@ -308,7 +309,8 @@ GIT_EXTERN(int) git_reference_symbolic_set_target(
* @param id The new target OID for the reference
* @param signature The identity that will used to populate the reflog entry
* @param log_message The one line long message to be appended to the reflog
- * @return 0 or an error code
+ * @return 0 on success, GIT_EMODIFIED if the value of the reference
+ * has changed, or an error code
*/
GIT_EXTERN(int) git_reference_set_target(
git_reference **out,