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

Sparse index: checkout-index #424

Merged
merged 5 commits into from
Sep 14, 2021
Merged

Sparse index: checkout-index #424

merged 5 commits into from
Sep 14, 2021

Commits on Sep 13, 2021

  1. checkout-index: expand sparse checkout compatibility tests

    Add tests to cover basic `checkout-index` cases related to sparse checkouts:
    files and folder, both inside and outside of sparse checkout definition. New
    tests will serve as a baseline for expected behavior when integrating
    `checkout-index` with the sparse index.
    
    Of note is the test demonstrating the behavior of `checkout-index --all`;
    creating files even outside the sparse checkout definition is somewhat
    unintuitive, and will cause significant performance issues when run with a
    sparse index. The goal of later changes will be to change this default
    behavior and introduce a `--sparse` flag to enable populating files outside
    the sparse definition.
    
    Signed-off-by: Victoria Dye <vdye@github.com>
    vdye committed Sep 13, 2021
    Configuration menu
    Copy the full SHA
    7d45ff5 View commit details
    Browse the repository at this point in the history
  2. checkout-index: add --sparse option

    Change the default behavior of `checkout-index --all` for sparse checkouts
    to no longer refresh files outside the sparse checkout definition. The
    newly-added `--sparse` option, when used with `--all`, maintains the "old"
    behavior and checks out files outside the sparse checkout definition.
    
    Signed-off-by: Victoria Dye <vdye@github.com>
    vdye committed Sep 13, 2021
    Configuration menu
    Copy the full SHA
    cf3e9f4 View commit details
    Browse the repository at this point in the history
  3. checkout-index: integrate with sparse index

    Add repository settings to allow usage of the sparse index. In order to prevent
    unexpected errors when attempting to check out a sparse directory entry,
    `checkout_file` directly checks whether a found entry is a sparse directory
    and, if so, exits with an error. The test corresponding to this case now
    verifies the error message, intentionally differing from the non-sparse index
    scenarios.
    
    Signed-off-by: Victoria Dye <vdye@github.com>
    vdye committed Sep 13, 2021
    Configuration menu
    Copy the full SHA
    2e96d80 View commit details
    Browse the repository at this point in the history
  4. checkout-index: improve ensure_full_index scope in checkout_all

    Update `checkout_all` to only run `ensure_full_index` when entries in
    sparse directories are needed (i.e., `--sparse` is specified).
    
    Signed-off-by: Victoria Dye <vdye@github.com>
    vdye committed Sep 13, 2021
    Configuration menu
    Copy the full SHA
    50367bf View commit details
    Browse the repository at this point in the history
  5. checkout-index: add performance test for checkout-index --all

    `git checkout-index --all` is a subcommand of `git stash`, so it is helpful
    to verify the performance of that particular usage.
    
    Signed-off-by: Victoria Dye <vdye@github.com>
    vdye committed Sep 13, 2021
    Configuration menu
    Copy the full SHA
    61c3288 View commit details
    Browse the repository at this point in the history