Skip to content

Commit a2d57e2

Browse files
ttaylorrgitster
authored andcommitted
commit-graph.c: don't use discarded graph_name in error
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7a9ce02 commit a2d57e2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

commit-graph.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1397,7 +1397,7 @@ static int write_commit_graph_file(struct write_commit_graph_context *ctx)
13971397

13981398
fd = git_mkstemp_mode(ctx->graph_name, 0444);
13991399
if (fd < 0) {
1400-
error(_("unable to create '%s'"), ctx->graph_name);
1400+
error(_("unable to create temporary graph layer"));
14011401
return -1;
14021402
}
14031403

0 commit comments

Comments
 (0)