X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft3306-notes-prune.sh;h=b4554041b49d1ab7b56430f2e85b76a23d360fb4;hb=c255a70b5ef4e70070b6076c4308da9d163d56a9;hp=a0ed0353e69dd6dbc96f1a8e3c9251757b4f408f;hpb=e1ba0f6340c1d72677c7792a0a82ecf05363026e;p=git.git diff --git a/t/t3306-notes-prune.sh b/t/t3306-notes-prune.sh index a0ed0353e..b4554041b 100755 --- a/t/t3306-notes-prune.sh +++ b/t/t3306-notes-prune.sh @@ -60,7 +60,7 @@ test_expect_success 'verify commits and notes' ' test_expect_success 'remove some commits' ' - git reset --hard HEAD~2 && + git reset --hard HEAD~1 && git reflog expire --expire=now HEAD && git gc --prune=now ' @@ -68,7 +68,7 @@ test_expect_success 'remove some commits' ' test_expect_success 'verify that commits are gone' ' ! git cat-file -p 5ee1c35e83ea47cd3cc4f8cbee0568915fbbbd29 && - ! git cat-file -p 08341ad9e94faa089d60fd3f523affb25c6da189 && + git cat-file -p 08341ad9e94faa089d60fd3f523affb25c6da189 && git cat-file -p ab5f302035f2e7aaf04265f08b42034c23256e1f ' @@ -79,11 +79,55 @@ test_expect_success 'verify that notes are still present' ' git notes show ab5f302035f2e7aaf04265f08b42034c23256e1f ' +test_expect_success 'prune -n does not remove notes' ' + + git notes list > expect && + git notes prune -n && + git notes list > actual && + test_cmp expect actual +' + +cat > expect < actual && + test_cmp expect actual +' + + test_expect_success 'prune notes' ' git notes prune ' +test_expect_success 'verify that notes are gone' ' + + ! git notes show 5ee1c35e83ea47cd3cc4f8cbee0568915fbbbd29 && + git notes show 08341ad9e94faa089d60fd3f523affb25c6da189 && + git notes show ab5f302035f2e7aaf04265f08b42034c23256e1f +' + +test_expect_success 'remove some commits' ' + + git reset --hard HEAD~1 && + git reflog expire --expire=now HEAD && + git gc --prune=now +' + +cat > expect < actual && + test_cmp expect actual +' + test_expect_success 'verify that notes are gone' ' ! git notes show 5ee1c35e83ea47cd3cc4f8cbee0568915fbbbd29 &&