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

Add test to check prune command retains tagged unpushed objects #4962

Merged
merged 2 commits into from Apr 25, 2022

Commits on Apr 25, 2022

  1. t/t-prune.sh: add tag check to unpushed test

    In PR git-lfs#742 the "git lfs prune" command was introduced along with
    accompanying tests, one of which is the "prune keep unpushed"
    test that checks whether Git LFS objects referenced by not-yet-
    pushed commits are always retained by "git lfs prune".
    
    In commit 978899e of that PR
    the initial version of the "prune" tests included some fixture
    data with commits that were referenced via a tag only, not via
    a branch ref.  However, the test never confirmed that the Git LFS
    objects in these commits were retained by the "prune" command.
    
    This initial test was then refactored into several tests in
    commits 03b85e0 and
    58dfa23, including the "prune
    keep unpushed" one, and in the process two lines were left
    which referred to the fixture data ("oid_keepunpushedtagged1"
    and "oid_keepunpushedtagged2") but this data was otherwise
    dropped from the test, and no tag check was implemented.
    
    We therefore re-introduce some fixture data for this test
    which simulates a tag that points to a commit from a deleted
    branch, so that the tag is the only reference to this commit
    and its ancestors.  We then ensure that "git lfs prune" retains
    all the Git LFS objects from these commits, even if they
    are not recent, when they have not been pushed.  Once they are
    pushed, we then confirm that only the object in the tagged commit
    is retained (because it is a referenced by a recent ref).
    
    We also update a comment in the "prune unreferenced and old"
    test which refers to a filename in its fixture data that
    corresponds to how it was originally defined in commit
    978899e, but which was
    subsequently changed (at the same time the comment was added)
    in commit 03b85e0.
    chrisd8088 committed Apr 25, 2022
    Configuration menu
    Copy the full SHA
    cb151ee View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d7c5885 View commit details
    Browse the repository at this point in the history