summaryrefslogtreecommitdiff
path: root/refs.h
diff options
context:
space:
mode:
authorDavid Turner <dturner@twopensource.com>2015-07-21 17:04:50 -0400
committerJunio C Hamano <gitster@pobox.com>2015-07-21 14:07:28 -0700
commita4c653dfcd05c987028b847092a1ee7e5d86a596 (patch)
tree165a443b3011713619fee6ea2c046039edf96568 /refs.h
parent912bd497e93f0235a5999a77f8d54f5ff80a3a03 (diff)
downloadgit-a4c653dfcd05c987028b847092a1ee7e5d86a596.tar.gz
refs.c: add err arguments to reflog functions
Add an err argument to log_ref_setup that can explain the reason for a failure. This then eliminates the need to manage errno through this function since we can just add strerror(errno) to the err string when meaningful. No callers relied on errno from this function for anything else than the error message. Also add err arguments to private functions write_ref_to_lockfile, log_ref_write_1, commit_ref_update. This again eliminates the need to manage errno in these functions. Some error messages are slightly reordered. Update of a patch by Ronnie Sahlberg. Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: David Turner <dturner@twopensource.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.h')
-rw-r--r--refs.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/refs.h b/refs.h
index 8c3d433a8a..7cfc2e080e 100644
--- a/refs.h
+++ b/refs.h
@@ -189,9 +189,9 @@ extern int peel_ref(const char *refname, unsigned char *sha1);
#define REF_NODEREF 0x01
/*
- * Setup reflog before using. Set errno to something meaningful on failure.
+ * Setup reflog before using. Fill in err and return -1 on failure.
*/
-int log_ref_setup(const char *refname, struct strbuf *logfile);
+int log_ref_setup(const char *refname, struct strbuf *logfile, struct strbuf *err);
/** Reads log for the value of ref during at_time. **/
extern int read_ref_at(const char *refname, unsigned int flags,