Add a strbug argument to the update reflog transaction call so we can return
an error string back to the caller on failure.

Signed-off-by: Ronnie Sahlberg <sahlb...@google.com>
---
 builtin/reflog.c | 6 ++++--
 refs.c           | 3 ++-
 refs.h           | 3 ++-
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/builtin/reflog.c b/builtin/reflog.c
index 5f07647..2239249 100644
--- a/builtin/reflog.c
+++ b/builtin/reflog.c
@@ -319,7 +319,8 @@ static int expire_reflog_ent(unsigned char *osha1, unsigned 
char *nsha1,
 
        if (cb->t) {
                transaction_update_reflog(cb->t, cb->refname, nsha1, osha1,
-                                         email, timestamp, tz, message, 0);
+                                         email, timestamp, tz, message, 0,
+                                         NULL);
                hashcpy(cb->last_kept_sha1, nsha1);
        }
        if (cb->cmd->verbose)
@@ -372,7 +373,8 @@ static int expire_reflog(const char *ref, const unsigned 
char *sha1, int unused,
                transaction_update_reflog(cb.t, cb.refname,
                                          null_sha1, null_sha1, NULL,
                                          0, 0, NULL,
-                                         REFLOG_TRUNCATE);
+                                         REFLOG_TRUNCATE,
+                                         NULL);
        }
 
        cb.cmd = cmd;
diff --git a/refs.c b/refs.c
index 59f1ca1..8b09258 100644
--- a/refs.c
+++ b/refs.c
@@ -3367,7 +3367,8 @@ int transaction_update_reflog(struct ref_transaction 
*transaction,
                              const unsigned char *email,
                              unsigned long timestamp, int tz,
                              const char *msg,
-                             int flags)
+                             int flags,
+                             struct strbuf *err)
 {
        struct ref_update *update;
        int i;
diff --git a/refs.h b/refs.h
index ebe7368..6c628bb 100644
--- a/refs.h
+++ b/refs.h
@@ -285,7 +285,8 @@ int transaction_update_reflog(struct ref_transaction 
*transaction,
                              const unsigned char *email,
                              unsigned long timestamp, int tz,
                              const char *msg,
-                             int flags);
+                             int flags,
+                             struct strbuf *err);
 
 /*
  * Commit all of the changes that have been queued in transaction, as
-- 
2.0.0.rc3.506.g3739a35

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to