Skip to content
Snippets Groups Projects
  1. Dec 01, 2021
  2. Nov 06, 2021
  3. Oct 15, 2021
  4. Mar 30, 2021
    • brian m. carlson's avatar
      Merge pull request #4 from bk2204/eof-handling · 06e9096e
      brian m. carlson authored
      reader: properly implement io.Reader
    • brian m. carlson's avatar
      reader: properly implement io.Reader · 58d38b12
      brian m. carlson authored
      The io.Reader interface specifies that once we reach an EOF indicator,
      the next read from the stream should return 0, io.EOF.  However, our
      reader didn't work that way, causing us to attempt to read the next
      packet from the underlying reader.  In some cases, such a packet won't
      exist until we've responded to the one we already got, causing us to hang.
      
      This was fixed in git-lfs/git-lfs#3902, but never ported over to here.
      Let's port that change over here, and add a Reset method to allow users
      to continue with the next packet if there's more data to read from the
      underlying stream.
  5. Feb 10, 2021
    • brian m. carlson's avatar
      Merge pull request #3 from bk2204/delim-packets · e90ca554
      brian m. carlson authored
      Add support for delimiter and empty packets
    • brian m. carlson's avatar
      Handle empty packets · 851f92e3
      brian m. carlson authored
      While the Git protocol documentation recommends that implementations
      SHOULD NOT emit empty packets, they are still valid packets, and we
      should handle them.  Let's make sure we handle them correctly and return
      a nil body for a flush or delimiter packet and non-nil body for an empty
      packet and add tests for these cases.  We change our invalid packets to
      contain 0003 instead.
    • brian m. carlson's avatar
      Implement reading delimiter packets · 659d3bc6
      brian m. carlson authored
      Currently our read code knows nothing about delimiter packets and
      rejects them as invalid.  However, even if we allowed such packets, we
      couldn't distinguish them from flush packets.  We currently return nil
      as the array for flush packets and an empty but non-nil array for empty
      packets (those with the header 0004), but there is no other valid value
      we could use to represent delimiter packets.
      
      To help solve this problem in the cases we care about, let's add an
      additional set of functions which return the packet header length so we
      can distinguish between these cases and write correct code.  We also
      update the existing ReadPacketList function to distinguish between empty
      packets (which we also don't currently support) and flush packets, and
      add tests for all of these cases.
  6. Feb 08, 2021
  7. Sep 14, 2020
  8. Feb 25, 2020
  9. Feb 24, 2020
    • brian m. carlson's avatar
      Add a README and license · 013e9cb2
      brian m. carlson authored
      Add a basic README file and include the license from Git LFS, whence
      this code derives.
    • brian m. carlson's avatar
      Add readers and writers from Pktline objects · 1737a60e
      brian m. carlson authored
      Since we now expose the underlying Pktline objects, let's add reader and
      writer objects that work with the underlying Pktline objects so that
      people can usefully use them together.  Change some of the tests to use
      this new method so that we can get coverage of all cases.
    • brian m. carlson's avatar
      Modernize and expand public interface · ab432e4c
      brian m. carlson authored
      Expand the public interface to include all of the low-level pkt-line
      methods so that people can use them.  Allow instantiating every class by
      itself.  Pull in the minInt function as a helper method so it's not
      necessary to depend on Git LFS and this library can be used by others.
      
      Finally, set the repository up for Go modules so it can be independently
      tested.
  10. Aug 10, 2017
  11. Aug 08, 2017
  12. Aug 04, 2017
  13. Aug 02, 2017
  14. Nov 22, 2016
    • Taylor Blau's avatar
      git: remove extraneous length check · 63b090d2
      Taylor Blau authored
      `n`, representing the total number of bytes we have read into `p`, can never
      become `>len(p)`. As such, let's remove a check for that impossible condition.
      63b090d2
    • Lars Schneider's avatar
      filter-process: fix reading 1024 byte files · 0cb9faf4
      Lars Schneider authored
      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
      0cb9faf4
  15. Nov 15, 2016
  16. Nov 11, 2016
  17. Nov 10, 2016
  18. Nov 09, 2016
  19. Nov 08, 2016
Loading