Commit Graph

3 Commits

Author SHA1 Message Date
Lars Schneider
53fcd96c95 filter-process: fix reading 1024 byte files
If we read exactly the number of bytes that fit into `p` then
implementation detected already an "overfilled" buffer and returned
the number of read bytes `n` and `nil` as error.

Fix this by treading the exact number not as "overfill". This way the
next `readPacket()` call we will read an empty chunk and `read()` will
return the number of read bytes `n` and `o.EOF` as (legitmate) error.

c.f. https://github.com/git-lfs/git-lfs/issues/1697
2016-11-22 12:21:48 +01:00
Taylor Blau
f89c31bae4 git/pl: flush underlying *bufio.Writer only when necessary
Previously, we flushed intermediate data out of the underlying *bufio.Writer
used by the implementation of `pkt-line` in `*git.pktline` after _every_ write.
This means that we would flush after partial packets, whole packets, and after
pkt-line flush sequences. This is unnecessary.

Let us instead flush only after an entire packet has been written, after
writing the `0000` flush sequence.

/ref git-lfs/git-lfs#1640
2016-11-15 14:35:21 -07:00
Taylor Blau
2188c26219 git/pr: 💅 2016-11-08 18:46:32 -07:00