Skip to content

Commit

Permalink
sequencer.c: fix and unify error messages in rearrange_squash()
Browse files Browse the repository at this point in the history
When the write opertion fails, we write that we could
not read. Change the error message to match the operation
and remove the full stop at the end.

When ftruncate() fails, we write that we couldn't finish
the operation on the todo file. It is more accurate to write
that we couldn't truncate as we do in other calls of ftruncate().

Signed-off-by: Ralf Thielow <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
ralfth authored and gitster committed Oct 16, 2017
1 parent dfab1ea commit 3247edb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sequencer.c
Original file line number Diff line number Diff line change
Expand Up @@ -2926,9 +2926,9 @@ int rearrange_squash(void)
if (fd < 0)
res = error_errno(_("could not open '%s'"), todo_file);
else if (write(fd, buf.buf, buf.len) < 0)
res = error_errno(_("could not read '%s'."), todo_file);
res = error_errno(_("could not write '%s'"), todo_file);
else if (ftruncate(fd, buf.len) < 0)
res = error_errno(_("could not finish '%s'"),
res = error_errno(_("could not truncate '%s'"),
todo_file);
close(fd);
strbuf_release(&buf);
Expand Down

0 comments on commit 3247edb

Please sign in to comment.