fbceac20f5
When looking for Git LFS pointers in the Git stash in order to avoid pruning the corresponding local objects during a "git lfs prune" command, we want to avoid looking further back in the Git log file than necessary; otherwise, we may potentially find many LFS object references which we should prune but incorrectly consider to be part of the stashes. We therefore proceed in two steps; first looking solely at each stash entry's WIP merge commit using the command "git log -m --first-parent <stash-sha>^..<stash-sha>", and then looking at each entry's index merge commit and possible additional untracked files merge commit using the command "git log <stash-sha>^..<stash-sha>". By limiting these commands' commit ranges to just the stash merge commits, we skip improperly traversing the full log. We update the relevant tests to include older commits, one of which should be pruned in each case; note that with these changes the tests fail with the previous version of the "git lfs prune" logic for stashes. We also add stashes to two other tests and confirm that in both cases the LFS objects from the stashed commits are retained, but no additional objects are also unexpectedly retained as a result of the stash. |
||
---|---|---|
.. | ||
attribute.go | ||
config_test.go | ||
config.go | ||
diff_index_scanner.go | ||
extension.go | ||
gitfilter_clean.go | ||
gitfilter_smudge.go | ||
gitfilter.go | ||
gitscanner_catfilebatch.go | ||
gitscanner_catfilebatchcheck.go | ||
gitscanner_catfilebatchcheckscanner_test.go | ||
gitscanner_index.go | ||
gitscanner_log.go | ||
gitscanner_pointerscanner_test.go | ||
gitscanner_refs.go | ||
gitscanner_remotes.go | ||
gitscanner_tree.go | ||
gitscanner.go | ||
hook.go | ||
lfs_test.go | ||
lfs.go | ||
pointer_test.go | ||
pointer.go | ||
scanner_git_test.go | ||
scanner_test.go | ||
scanner.go | ||
util_generic.go | ||
util_test.go | ||
util.go |