diff options
author | Jeff King <peff@peff.net> | 2019-01-07 09:39:33 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-01-08 18:41:06 +0100 |
commit | 2c319886c04c5e77da55c66ee9e860b101e5af32 (patch) | |
tree | b8d414b9f62bca7e79565f2388177aec50236ff0 /sha1-file.c | |
parent | sha1-file: prefer "loose object file" to "sha1 file" in messages (diff) | |
download | git-2c319886c04c5e77da55c66ee9e860b101e5af32.tar.xz git-2c319886c04c5e77da55c66ee9e860b101e5af32.zip |
sha1-file: avoid "sha1 file" for generic use in messages
These error messages say "sha1 file", which is vague and not common in
user-facing documentation. Unlike the conversions from the previous
commit, these do not always refer to loose objects.
In finalize_object_file() we could be dealing with a packfile. Let's
just say "unable to write file" instead; since we include the filename,
the nature of the file is clear from the rest of the message.
In force_object_loose(), we're calling into read_object(), which could
actually be _any_ type of object. Just say "object".
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sha1-file.c')
-rw-r--r-- | sha1-file.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sha1-file.c b/sha1-file.c index 7a121f39e8..39cdf378a5 100644 --- a/sha1-file.c +++ b/sha1-file.c @@ -1521,7 +1521,7 @@ int finalize_object_file(const char *tmpfile, const char *filename) unlink_or_warn(tmpfile); if (ret) { if (ret != EEXIST) { - return error_errno(_("unable to write sha1 filename %s"), filename); + return error_errno(_("unable to write file %s"), filename); } /* FIXME!!! Collision check here ? */ } @@ -1744,7 +1744,7 @@ int force_object_loose(const struct object_id *oid, time_t mtime) return 0; buf = read_object(oid, &type, &len); if (!buf) - return error(_("cannot read sha1_file for %s"), oid_to_hex(oid)); + return error(_("cannot read object for %s"), oid_to_hex(oid)); hdrlen = xsnprintf(hdr, sizeof(hdr), "%s %"PRIuMAX , type_name(type), (uintmax_t)len) + 1; ret = write_loose_object(oid, hdr, hdrlen, buf, len, mtime); free(buf); |