{"thread":{"id":"12824","subject":"[PATCH 1/2] Add tests for git-prune","startedAt":"2008-03-23T21:34:34Z","lastAt":"2008-03-23T21:34:34Z","messageCount":1,"participants":["Michele Ballabio"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"72813","messageId":"200803232234.34748.barra_cuda@katamail.com","threadId":"12824","inReplyTo":null,"subject":"[PATCH 1/2] Add tests for git-prune","fromName":"Michele Ballabio","fromEmail":"barra_cuda@katamail.com","sentAt":"2008-03-23T21:34:34Z","receivedAt":"2008-03-23T21:34:34Z","isPatch":true,"sender":{"key":"barra_cuda@katamail.com","avatar":"https://avatars.githubusercontent.com/u/16371673?v=4"},"body":"It seems that git prune changed behaviour with respect to revisions added\nfrom command line, probably when it became a builtin. Currently, it prints\na short usage and exits: instead, it should take those revisions into\naccount and not prune them. So add a couple of test to point this out.\n\nSigned-off-by: Michele Ballabio <barra_cuda@katamail.com>\n---\n\nThis is a resend, with some minor changes and a follow-up.\nI'm still not sure if\n\tmv .git/logs .git/logs.old\nshould be moved outside of the test or not.\n\n t/t5304-prune.sh |   26 ++++++++++++++++++++++++++\n 1 files changed, 26 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t5304-prune.sh b/t/t5304-prune.sh\nindex 47090c4..d5f12f7 100644\n--- a/t/t5304-prune.sh\n+++ b/t/t5304-prune.sh\n@@ -78,4 +78,30 @@ test_expect_success 'gc: start with ok gc.pruneExpire' '\n \n '\n \n+test_expect_success 'prune: prune unreachable heads' '\n+\n+\tgit config core.logAllRefUpdates false &&\n+\tmv .git/logs .git/logs.old &&\n+\t: > file2 &&\n+\tgit add file2 &&\n+\tgit commit -m temporary &&\n+\ttmp_head=$(git rev-list -1 HEAD) &&\n+\tgit reset HEAD^ &&\n+\tgit prune &&\n+\ttest_must_fail git reset $tmp_head --\n+\n+'\n+\n+test_expect_failure 'prune: do not prune heads listed as an argument' '\n+\n+\t: > file2 &&\n+\tgit add file2 &&\n+\tgit commit -m temporary &&\n+\ttmp_head=$(git rev-list -1 HEAD) &&\n+\tgit reset HEAD^ &&\n+\tgit prune -- $tmp_head &&\n+\tgit reset $tmp_head --\n+\n+'\n+\n test_done\n-- \n1.5.4.3\n"}]}