From 8785a7e0a1a56037edff0936ca67e59f1ff2c84e Mon Sep 17 00:00:00 2001 From: Chris Darroch Date: Tue, 23 Mar 2021 22:34:45 -0700 Subject: [PATCH] t: reorder prune stash checks to match actions We slightly reorder the assertions following the "git stash" command in several of our tests of the "git lfs prune" command so that the assertions are made in the same order as the stashed modifications. This will ease the addition of more assertions in subsequent commits. We also drop the unnecessary cleanup of the stash and working tree at the end of one test. --- t/t-prune.sh | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/t/t-prune.sh b/t/t-prune.sh index 970b1cf5..1bdeebaa 100755 --- a/t/t-prune.sh +++ b/t/t-prune.sh @@ -718,22 +718,16 @@ begin_test "prune keep stashed changes in index" git stash # Prove that the stashed data was stored in LFS (should call clean filter) - assert_local_object "$oid_stashed" "${#content_stashed}" assert_local_object "$oid_indexstashed" "${#content_indexstashed}" + assert_local_object "$oid_stashed" "${#content_stashed}" # Prune data, should NOT delete stashed file or stashed changes to index git lfs prune refute_local_object "$oid_oldandpushed" "${#content_oldandpushed}" assert_local_object "$oid_retain1" "${#content_retain1}" - assert_local_object "$oid_stashed" "${#content_stashed}" assert_local_object "$oid_indexstashed" "${#content_indexstashed}" - - # Restore working tree from stash - git stash pop --index - - # Reset working tree to index from stash - git checkout . + assert_local_object "$oid_stashed" "${#content_stashed}" ) end_test @@ -802,8 +796,8 @@ begin_test "prune keep stashed untracked files" git stash -u # Prove that ALL stashed data was stored in LFS (should call clean filter) - assert_local_object "$oid_stashed" "${#content_stashed}" assert_local_object "$oid_indexstashed" "${#content_indexstashed}" + assert_local_object "$oid_stashed" "${#content_stashed}" assert_local_object "$oid_untrackedstashed" "${#content_untrackedstashed}" # Prune data, should NOT delete stashed file or stashed changes to index @@ -811,8 +805,8 @@ begin_test "prune keep stashed untracked files" refute_local_object "$oid_oldandpushed" "${#content_oldandpushed}" assert_local_object "$oid_retain1" "${#content_retain1}" - assert_local_object "$oid_stashed" "${#content_stashed}" assert_local_object "$oid_indexstashed" "${#content_indexstashed}" + assert_local_object "$oid_stashed" "${#content_stashed}" assert_local_object "$oid_untrackedstashed" "${#content_untrackedstashed}" ) end_test