{"thread":{"id":"12714","subject":"[PATCH] Add tests for git prune","startedAt":"2008-03-16T17:04:48Z","lastAt":"2008-03-16T17:04:48Z","messageCount":1,"participants":["Michele Ballabio"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"72221","messageId":"200803161804.48573.barra_cuda@katamail.com","threadId":"12714","inReplyTo":null,"subject":"[PATCH] Add tests for git prune","fromName":"Michele Ballabio","fromEmail":"barra_cuda@katamail.com","sentAt":"2008-03-16T17:04:48Z","receivedAt":"2008-03-16T17:04:48Z","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\nI'm not sure if I've disabled core.logAllRefUpdates correctly...\n\nIs it ok to do this?\n\n+\tmv .git/logs .git/logs.old &&\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..d5fad4c 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"}]}