Commit 6d0a3d9
t7004: drop hardcoded tag count in invalid name test
The test 'trying to create a tag with a non-valid name should fail',
checked that exactly one tag existed in the repository before and after
attempting to create invalid tags.
As pointed out by Junio, this makes the test brittle by relying on a
specific global tag count. If future tests are added or removed before
this test, the expected state changes and this test would break for
completely unrelated reasons.
Since we already use 'test_must_fail' to guarantee that the invalid
tags are rejected by Git, counting the tags before and after is redundant.
Drop the 'test_line_count = 1' checks so the test doesn't rely on the
exact number of tags left behind by earlier tests.
Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Siddharth Shrimali <r.siddharth.shrimali@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 42148da commit 6d0a3d9
1 file changed
Lines changed: 1 addition & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
195 | | - | |
196 | 194 | | |
197 | 195 | | |
198 | 196 | | |
199 | 197 | | |
200 | | - | |
201 | | - | |
202 | | - | |
| 198 | + | |
203 | 199 | | |
204 | 200 | | |
205 | 201 | | |
| |||
0 commit comments