diff options
author | Michael J Gruber <git@drmicha.warpmail.net> | 2015-06-01 15:50:04 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-06-01 15:54:29 -0700 |
commit | 75f39dec396031ece8f36c8984bb3f46532f3b34 (patch) | |
tree | 1fb26e073608df6f2897883a43b4096862829dda | |
parent | 3d4a3ffe64162b45ae7c991fc60623ecb4678cfd (diff) | |
download | git-75f39dec396031ece8f36c8984bb3f46532f3b34.tar.gz |
show-index: uniform error messages for index read
Currently, we have different wordings for the same index read error
message, which may be confusing to users and increase3s the risk of more
severely different translated messages:
builtin/apply.c: die(_("unable to read index file"));
show-index.c: die("unable to read index");
show-index.c: die("unable to read index");
test-dump-cache-tree.c: die("unable to read index file");
test-dump-untracked-cache.c: die("unable to read index file");
test-scrap-cache-tree.c: die("unable to read index file");
builtin/commit.c: die(_("Cannot read index"));
rerere.c: return error("Could not read index");
rerere.c: return error("Could not read index");
rerere.c: return error("Could not read index");
Turn all of them into "unable to read index file" except for the rerere
messages: They appear on a higher level (index file access + parsing)
and are worded similarly to other rerere messages.
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | builtin/commit.c | 2 | ||||
-rw-r--r-- | show-index.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/builtin/commit.c b/builtin/commit.c index da79ac4bc7..2bc5092a57 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -878,7 +878,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix, const char *parent = "HEAD"; if (!active_nr && read_cache() < 0) - die(_("Cannot read index")); + die(_("unable to read index file")); if (amend) parent = "HEAD^1"; diff --git a/show-index.c b/show-index.c index 5a9eed7fd8..e7797d0802 100644 --- a/show-index.c +++ b/show-index.c @@ -22,11 +22,11 @@ int main(int argc, char **argv) if (version < 2 || version > 2) die("unknown index version"); if (fread(top_index, 256 * 4, 1, stdin) != 1) - die("unable to read index"); + die("unable to read index file"); } else { version = 1; if (fread(&top_index[2], 254 * 4, 1, stdin) != 1) - die("unable to read index"); + die("unable to read index file"); } nr = 0; for (i = 0; i < 256; i++) { |