aboutsummaryrefslogtreecommitdiff
path: root/credential-store.c
diff options
context:
space:
mode:
authorSZEDER Gábor <szeder@ira.uka.de>2015-11-30 12:40:53 +0100
committerJeff King <peff@peff.net>2015-12-01 18:17:23 -0500
commit08a3651fe7f3163acbac461e0daf370329a1d332 (patch)
treeba2b115940bd2fa7199e6482426a823386c49fe0 /credential-store.c
parent908a6e4156dff47d4877478383fd4b79592010e2 (diff)
downloadgit-08a3651fe7f3163acbac461e0daf370329a1d332.tar.gz
git-08a3651fe7f3163acbac461e0daf370329a1d332.tar.xz
Make error message after failing commit_lock_file() less confusing
The error message after a failing commit_lock_file() call sometimes looks like this, causing confusion: $ git remote add remote git@server.com/repo.git error: could not commit config file .git/config # Huh?! # I didn't want to commit anything, especially not my config file! While in the narrow context of the lockfile module using the verb 'commit' in the error message makes perfect sense, in the broader context of git the word 'commit' already has a very specific meaning, hence the confusion. Reword these error messages to say "could not write" instead of "could not commit". While at it, include strerror in the error messages after writing the config file or the credential store fails to provide some information about the cause of the failure, and update the style of the error message after writing the reflog fails to match surrounding error messages (i.e. no '' around the pathname and no () around the error description). Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Jeff King <peff@peff.net>
Diffstat (limited to 'credential-store.c')
-rw-r--r--credential-store.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/credential-store.c b/credential-store.c
index 00aea3aa3..fc67d16c1 100644
--- a/credential-store.c
+++ b/credential-store.c
@@ -64,7 +64,8 @@ static void rewrite_credential_file(const char *fn, struct credential *c,
print_line(extra);
parse_credential_file(fn, c, NULL, print_line);
if (commit_lock_file(&credential_lock) < 0)
- die_errno("unable to commit credential store");
+ die_errno("unable to write credential store: %s",
+ strerror(errno));
}
static void store_credential_file(const char *fn, struct credential *c)