Skip to content

Commit 3247edb

Browse files
ralfthgitster
authored andcommitted
sequencer.c: fix and unify error messages in rearrange_squash()
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]>
1 parent dfab1ea commit 3247edb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sequencer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2926,9 +2926,9 @@ int rearrange_squash(void)
29262926
if (fd < 0)
29272927
res = error_errno(_("could not open '%s'"), todo_file);
29282928
else if (write(fd, buf.buf, buf.len) < 0)
2929-
res = error_errno(_("could not read '%s'."), todo_file);
2929+
res = error_errno(_("could not write '%s'"), todo_file);
29302930
else if (ftruncate(fd, buf.len) < 0)
2931-
res = error_errno(_("could not finish '%s'"),
2931+
res = error_errno(_("could not truncate '%s'"),
29322932
todo_file);
29332933
close(fd);
29342934
strbuf_release(&buf);

0 commit comments

Comments
 (0)