Re: [PATCH 12/14] hold_lock_file_for_update: pass error message back through a strbuf
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Dec 3, 2014, 18:53 UTC
- Message-ID
- <20141203185303.GB31609@google.com>
- In-Reply-To
- <20141203052602.GV6527@google.com>
Jonathan Nieder wrote:
Show 13 quoted lines
> --- 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 <jrnieder@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);