Jonathan Nieder wrote:

> --- a/credential-store.c
> +++ b/credential-store.c
> @@ -55,13 +55,17 @@ static void print_line(struct strbuf *buf)
>  static void rewrite_credential_file(const char *fn, struct credential *c,
>                                   struct strbuf *extra)
>  {
> -     hold_lock_file_for_update(&credential_lock, fn,
> -                               LOCK_DIE_ON_ERROR | LOCK_OUTSIDE_REPOSITORY);
> +     struct strbuf err = STRBUF_INIT;
> +
> +     if (hold_lock_file_for_update(&credential_lock, fn,
> +                                   LOCK_OUTSIDE_REPOSITORY, &err) < 0);
> +             die("%s", err.buf);

I forgot to squash this in.  Sorry for the confusion.  (I'm planning to
reroll with this and the commit clarification tboegi mentioned --- other
comments welcome before then.)

-- >8 --
Subject: fixup! hold_lock_file_for_update: pass error message back through a 
strbuf

Signed-off-by: Jonathan Nieder <jrnie...@gmail.com>
---
 credential-store.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/credential-store.c b/credential-store.c
index beffa87..2d5d92f 100644
--- a/credential-store.c
+++ b/credential-store.c
@@ -58,7 +58,7 @@ static void rewrite_credential_file(const char *fn, struct 
credential *c,
        struct strbuf err = STRBUF_INIT;
 
        if (hold_lock_file_for_update(&credential_lock, fn,
-                                     LOCK_OUTSIDE_REPOSITORY, &err) < 0);
+                                     LOCK_OUTSIDE_REPOSITORY, &err) < 0)
                die("%s", err.buf);
        if (extra)
                print_line(extra);
--
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