path: root/t/
AgeCommit message (Collapse)Author
2008-02-02Sane use of test_expect_failureJunio C Hamano
Originally, test_expect_failure was designed to be the opposite of test_expect_success, but this was a bad decision. Most tests run a series of commands that leads to the single command that needs to be tested, like this: test_expect_{success,failure} 'test title' ' setup1 && setup2 && setup3 && what is to be tested ' And expecting a failure exit from the whole sequence misses the point of writing tests. Your setup$N that are supposed to succeed may have failed without even reaching what you are trying to test. The only valid use of test_expect_failure is to check a trivial single command that is expected to fail, which is a minority in tests of Porcelain-ish commands. This large-ish patch rewrites all uses of test_expect_failure to use test_expect_success and rewrites the condition of what is tested, like this: test_expect_success 'test title' ' setup1 && setup2 && setup3 && ! this command should fail ' test_expect_failure is redefined to serve as a reminder that that test *should* succeed but due to a known breakage in git it currently does not pass. So if git-foo command should create a file 'bar' but you discovered a bug that it doesn't, you can write a test like this: test_expect_failure 'git-foo should create bar' ' rm -f bar && git foo && test -f bar ' This construct acts similar to test_expect_success, but instead of reporting "ok/FAIL" like test_expect_success does, the outcome is reported as "FIXED/still broken". Signed-off-by: Junio C Hamano <>
2007-07-03Rewrite "git-frotz" to "git frotz"Junio C Hamano
This uses the remove-dashes target to replace "git-frotz" to "git frotz". Signed-off-by: Junio C Hamano <>
2007-01-26Fix seriously broken "git pack-refs"Linus Torvalds
Do *NOT* try this on a repository you care about: git pack-refs --all --prune git pack-refs because while the first "pack-refs" does the right thing, the second pack-refs will totally screw you over. This is because the second one tries to pack only tags; we should also pack what are already packed -- otherwise we would lose them. [jc: with an additional test] Signed-off-by: Junio C Hamano <>
2007-01-08--prune is now default for 'pack-refs'Junio C Hamano
There is no reason not to, really. Signed-off-by: Junio C Hamano <>
2006-10-19ref-log: fix D/F conflict coming from deleted refs.Junio C Hamano
After deleting a branch l/k, you should be able to create a branch l. Earlier we added remove_empty_directories() on the ref creation side to remove leftover .git/refs/l directory but we also need a matching code to remove .git/logs/refs/l directory. Signed-off-by: Junio C Hamano <>
2006-10-08git-pack-refs --allJunio C Hamano
This changes 'git-pack-refs' to pack only tags by default. Branches are meant to be updated, either by committing onto it yourself or tracking remote branches, and packed entries can become stale easily, but tags are usually "create once and live forever" and benefit more from packing. Signed-off-by: Junio C Hamano <>
2006-10-06Remove bashism from t3210-pack-refs.shDennis Stosberg
This bashism makes the test fail if /bin/sh is not bash. Signed-off-by: Dennis Stosberg <> Signed-off-by: Junio C Hamano <>
2006-10-01Clean up "" and add remove recursive dir test cases.Christian Couder
Now that directory recursive remove works in the core C code, we don't need to do it in "". Also add test cases to check that directory recursive remove will continue to work. Signed-off-by: Christian Couder <> Signed-off-by: Junio C Hamano <>
2006-09-28Uncomment test case: git branch c/d should barf if branch c exists.Christian Couder
Signed-off-by: Christian Couder <> Signed-off-by: Junio C Hamano <>
2006-09-28Add pack-refs and show-ref test cases.Christian Couder
Some of these test cases are from Junio. One test case is commented out because it doesn't work right now. Signed-off-by: Christian Couder <> Signed-off-by: Junio C Hamano <>