]> git.ipfire.org Git - thirdparty/git.git/commitdiff
commit-graph.c: don't use discarded graph_name in error
authorTaylor Blau <me@ttaylorr.com>
Thu, 23 Apr 2020 21:41:02 +0000 (15:41 -0600)
committerJunio C Hamano <gitster@pobox.com>
Thu, 23 Apr 2020 21:58:52 +0000 (14:58 -0700)
When writing a commit-graph layer, we do so in a temporary file which is
renamed into place. If we fail to create a temporary file, for e.g.,
because we have too many open files, then 'git_mkstemp_mode' sets the
pattern to the empty string, in which case we get an error something
along the lines of:

  error: unable to create ''

It's not useful to show the pattern here at all, since we (1) know the
pattern is well-formed, and (2) would have already shown the dirname
when trying to create the leading directories. So, replace this error
with something friendlier.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit-graph.c

index af677fc98edec2c984f9e196ae71bb2b7d88ab06..98bbbbfc32bb78023df7d4049db65a0bbf1295a9 100644 (file)
@@ -1397,7 +1397,7 @@ static int write_commit_graph_file(struct write_commit_graph_context *ctx)
 
                fd = git_mkstemp_mode(ctx->graph_name, 0444);
                if (fd < 0) {
-                       error(_("unable to create '%s'"), ctx->graph_name);
+                       error(_("unable to create temporary graph layer"));
                        return -1;
                }