t5704: match tests to modern style

The test did not adhere to the current style on several counts: . empty lines around the test blocks, but within the test string . ': > file' or even just '> file' with an extra space . inconsistent indentation . hand-rolled commits instead of using test_commit Fix all of them. There's a catch to the last point: test_commit creates a tag, which the original test did not create. We still change it to test_commit, and explicitly delete the tags, so as to highlight that the test relies on not having them. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Thomas Rast committed Feb 23, 2012 at 10:42 UTC 8a557bb77fc009b00f7952f0d3d6ebd33079f70e
1 file changed +8 -25
t/t5704-bundle.sh
+8 -25
@@ -4,59 +4,42 @@ test_description='some bundle related tests'
4 . ./test-lib.sh
5
6 test_expect_success 'setup' '
7 -
8 - : > file &&
9 - git add file &&
10 - test_tick &&
11 - git commit -m initial &&
7 + test_commit initial &&
8 test_tick &&
9 git tag -m tag tag &&
14 - : > file2 &&
15 - git add file2 &&
16 - : > file3 &&
17 - test_tick &&
18 - git commit -m second &&
19 - git add file3 &&
20 - test_tick &&
21 - git commit -m third
22 -
10 + test_commit second &&
11 + test_commit third &&
12 + git tag -d initial &&
13 + git tag -d second &&
14 + git tag -d third
15 '
16
17 test_expect_success 'tags can be excluded by rev-list options' '
26 -
18 git bundle create bundle --all --since=7.Apr.2005.15:16:00.-0700 &&
19 git ls-remote bundle > output &&
20 ! grep tag output
30 -
21 '
22
23 test_expect_success 'die if bundle file cannot be created' '
34 -
24 mkdir adir &&
25 test_must_fail git bundle create adir --all
37 -
26 '
27
28 test_expect_failure 'bundle --stdin' '
41 -
29 echo master | git bundle create stdin-bundle.bdl --stdin &&
30 git ls-remote stdin-bundle.bdl >output &&
31 grep master output
45 -
32 '
33
34 test_expect_failure 'bundle --stdin <rev-list options>' '
49 -
35 echo master | git bundle create hybrid-bundle.bdl --stdin tag &&
36 git ls-remote hybrid-bundle.bdl >output &&
37 grep master output
53 -
38 '
39
40 test_expect_success 'empty bundle file is rejected' '
57 -
58 - >empty-bundle && test_must_fail git fetch empty-bundle
59 -
41 + : >empty-bundle &&
42 + test_must_fail git fetch empty-bundle
43 '
44
45 # This triggers a bug in older versions where the resulting line (with