summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-12-11 11:14:18 -0800
committerJunio C Hamano <gitster@pobox.com>2015-12-11 11:14:18 -0800
commitabca668a93f0039c8c3fe81a6625fcdf81c35bdf (patch)
tree4c76311689c4e2f16694cf4cf2f7ee29cd4b54a8
parent76058817e80725a2fd1f4935289f663b7aefc024 (diff)
parent08a3651fe7f3163acbac461e0daf370329a1d332 (diff)
downloadgit-abca668a93f0039c8c3fe81a6625fcdf81c35bdf.tar.gz
Merge branch 'sg/lock-file-commit-error' into maint
Cosmetic improvement to lock-file error messages. * sg/lock-file-commit-error: Make error message after failing commit_lock_file() less confusing
-rw-r--r--config.c6
-rw-r--r--credential-store.c3
-rw-r--r--fast-import.c2
-rw-r--r--refs.c2
4 files changed, 8 insertions, 5 deletions
diff --git a/config.c b/config.c
index 248a21ab94..86a5eb2571 100644
--- a/config.c
+++ b/config.c
@@ -2144,7 +2144,8 @@ int git_config_set_multivar_in_file(const char *config_filename,
}
if (commit_lock_file(lock) < 0) {
- error("could not commit config file %s", config_filename);
+ error("could not write config file %s: %s", config_filename,
+ strerror(errno));
ret = CONFIG_NO_WRITE;
lock = NULL;
goto out_free;
@@ -2330,7 +2331,8 @@ int git_config_rename_section_in_file(const char *config_filename,
fclose(config_file);
unlock_and_out:
if (commit_lock_file(lock) < 0)
- ret = error("could not commit config file %s", config_filename);
+ ret = error("could not write config file %s: %s",
+ config_filename, strerror(errno));
out:
free(filename_buf);
return ret;
diff --git a/credential-store.c b/credential-store.c
index 00aea3aa30..fc67d16c10 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)
diff --git a/fast-import.c b/fast-import.c
index 6c7c3c9b66..b141535e11 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -1821,7 +1821,7 @@ static void dump_marks(void)
dump_marks_helper(f, 0, marks);
if (commit_lock_file(&mark_lock)) {
- failure |= error("Unable to commit marks file %s: %s",
+ failure |= error("Unable to write file %s: %s",
export_marks_file, strerror(errno));
return;
}
diff --git a/refs.c b/refs.c
index 4e15f60d98..9ac9a674a5 100644
--- a/refs.c
+++ b/refs.c
@@ -4643,7 +4643,7 @@ int reflog_expire(const char *refname, const unsigned char *sha1,
get_lock_file_path(lock->lk));
rollback_lock_file(&reflog_lock);
} else if (commit_lock_file(&reflog_lock)) {
- status |= error("unable to commit reflog '%s' (%s)",
+ status |= error("unable to write reflog %s: %s",
log_file, strerror(errno));
} else if (update && commit_ref(lock)) {
status |= error("couldn't set %s", lock->ref_name);