Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Git to v2.29.0 #1694

Merged
merged 5 commits into from
Oct 20, 2020
Merged

Commits on Oct 20, 2020

  1. Update Git to v2.29.0

    Signed-off-by: Derrick Stolee <[email protected]>
    derrickstolee committed Oct 20, 2020
    Configuration menu
    Copy the full SHA
    4ce8a1b View commit details
    Browse the repository at this point in the history
  2. PackfileMaintenanceStepTests: Git 2.29 does batching differently

    The last condition of this test no longer applies because Git will
    repack files in a different way than it used to.
    
    Signed-off-by: Derrick Stolee <[email protected]>
    derrickstolee committed Oct 20, 2020
    Configuration menu
    Copy the full SHA
    8411d90 View commit details
    Browse the repository at this point in the history
  3. Build: include SharpZipLib

    We will start hashing loose objects downloaded from the remotes, but we
    need to include a package (SharpZipLib) that can handle the headers
    included in the ZLib compression used by Git. .NET's default
    decompression algorithm cannot handle those optional headers,
    unfortunately.
    
    Signed-off-by: Derrick Stolee <[email protected]>
    derrickstolee committed Oct 20, 2020
    Configuration menu
    Copy the full SHA
    fd45a61 View commit details
    Browse the repository at this point in the history
  4. GitObjects: hash incoming loose objects

    After we write the data to disk, check the file that it matches the
    correct hash before moving it into place. If the hash is wrong, then
    include details about where the data is stored for reference.
    
    This can be marked as optional to make existing unit tests work, but the
    logic is covered by a new set of unit tests.
    
    Signed-off-by: Derrick Stolee <[email protected]>
    derrickstolee committed Oct 20, 2020
    Configuration menu
    Copy the full SHA
    b8e2283 View commit details
    Browse the repository at this point in the history
  5. GitObjects: use new SideChannelStream to hash during download

    The loose object download needs to verify the objects being sent across
    the wire before moving them to their "real" locations in the object
    directory. The previous implementation wrote them to disk then read from
    that file to hash the contents.
    
    Instead, create a new "SideChannelStream" that injects between the
    responseStream and the inflater, but sends all of the data that is read
    out to the filestream. Here is a diagram of the stream sequence:
    
      responseStream -> sideChannelStream -> inflateStream -> hashingStream
                               \                                   |
    			    \                                 \|/
    			     tempFileStream                devNull
    
    By copying all data from the hashingStream into devNull, we ensure that
    the responseStream is drained and written to the tempFileStream while
    simultaneously inflating and hashing the object contents. We then
    amortize this computation during the window that we are downloading data
    over the network, minimizing the potential performance impact.
    
    Helped-by: Matthew Cheetham <[email protected]>
    Signed-off-by: Derrick Stolee <[email protected]>
    derrickstolee committed Oct 20, 2020
    Configuration menu
    Copy the full SHA
    ded306b View commit details
    Browse the repository at this point in the history