summaryrefslogtreecommitdiff
path: root/src/refs.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-12-03 16:45:39 -0800
committerRussell Belfer <rb@github.com>2013-12-11 10:57:49 -0800
commit96869a4edb2872934e0e167a726ab240f4270fea (patch)
tree2d770414acef2d1d45a609e004c0aa6fa56d06d7 /src/refs.c
parent9f77b3f6f5ce6944ec49dfc666ef6b8df0af0c6b (diff)
downloadlibgit2-96869a4edb2872934e0e167a726ab240f4270fea.tar.gz
Improve GIT_EUSER handling
This adds giterr_user_cancel to return GIT_EUSER and clear any error message that is sitting around. As a result of using that in places, we need to be more thorough with capturing errors that happen inside a callback when used internally. To help with that, this also adds giterr_capture and giterr_restore so that when we internally use a foreach-type function that clears errors and converts them to GIT_EUSER, it is easier to restore not just the return value, but the actual error message text.
Diffstat (limited to 'src/refs.c')
-rw-r--r--src/refs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/refs.c b/src/refs.c
index 472a79890..bae62158b 100644
--- a/src/refs.c
+++ b/src/refs.c
@@ -471,7 +471,7 @@ int git_reference_rename(
if ((error = git_refdb_rename(out, ref->db, ref->name, new_name, force)) < 0)
return error;
- /* Update HEAD it was poiting to the reference being renamed. */
+ /* Update HEAD it was pointing to the reference being renamed */
if (should_head_be_updated &&
(error = git_repository_set_head(ref->db->repo, new_name)) < 0) {
giterr_set(GITERR_REFERENCE, "Failed to update HEAD after renaming reference");