2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-26 06:46:34 +00:00

Remove unnecessary pipe checks in termstatus

canUpdateStatus has already determined that the file descriptor is not a
pipe.
This commit is contained in:
greatroar 2020-02-29 17:37:36 +01:00
parent 7447c44484
commit 751eba0e68

View File

@ -19,12 +19,6 @@ func clearCurrentLine(wr io.Writer, fd uintptr) func(io.Writer, uintptr) {
return windowsClearCurrentLine
}
// check if the output file type is a pipe (0x0003)
if isPipe(fd) {
// return empty func, update state is not possible on this terminal
return func(io.Writer, uintptr) {}
}
// assume we're running in mintty/cygwin
return posixClearCurrentLine
}
@ -36,12 +30,6 @@ func moveCursorUp(wr io.Writer, fd uintptr) func(io.Writer, uintptr, int) {
return windowsMoveCursorUp
}
// check if the output file type is a pipe (0x0003)
if isPipe(fd) {
// return empty func, update state is not possible on this terminal
return func(io.Writer, uintptr, int) {}
}
// assume we're running in mintty/cygwin
return posixMoveCursorUp
}