|
31 | 31 | done |
32 | 32 |
|
33 | 33 | test_expect_success 'post-checkout runs as expected ' ' |
34 | | - GIT_DIR=clone1/.git git checkout master && |
35 | | - test -e clone1/.git/post-checkout.args |
| 34 | + GIT_DIR=clone1/.git git checkout master && |
| 35 | + test -e clone1/.git/post-checkout.args |
36 | 36 | ' |
37 | 37 |
|
38 | 38 | test_expect_success 'post-checkout receives the right arguments with HEAD unchanged ' ' |
39 | | - old=$(awk "{print \$1}" clone1/.git/post-checkout.args) && |
40 | | - new=$(awk "{print \$2}" clone1/.git/post-checkout.args) && |
41 | | - flag=$(awk "{print \$3}" clone1/.git/post-checkout.args) && |
42 | | - test $old = $new -a $flag = 1 |
| 39 | + old=$(awk "{print \$1}" clone1/.git/post-checkout.args) && |
| 40 | + new=$(awk "{print \$2}" clone1/.git/post-checkout.args) && |
| 41 | + flag=$(awk "{print \$3}" clone1/.git/post-checkout.args) && |
| 42 | + test $old = $new -a $flag = 1 |
43 | 43 | ' |
44 | 44 |
|
45 | 45 | test_expect_success 'post-checkout runs as expected ' ' |
46 | | - GIT_DIR=clone1/.git git checkout master && |
47 | | - test -e clone1/.git/post-checkout.args |
| 46 | + GIT_DIR=clone1/.git git checkout master && |
| 47 | + test -e clone1/.git/post-checkout.args |
48 | 48 | ' |
49 | 49 |
|
50 | 50 | test_expect_success 'post-checkout args are correct with git checkout -b ' ' |
51 | | - GIT_DIR=clone1/.git git checkout -b new1 && |
52 | | - old=$(awk "{print \$1}" clone1/.git/post-checkout.args) && |
53 | | - new=$(awk "{print \$2}" clone1/.git/post-checkout.args) && |
54 | | - flag=$(awk "{print \$3}" clone1/.git/post-checkout.args) && |
55 | | - test $old = $new -a $flag = 1 |
| 51 | + GIT_DIR=clone1/.git git checkout -b new1 && |
| 52 | + old=$(awk "{print \$1}" clone1/.git/post-checkout.args) && |
| 53 | + new=$(awk "{print \$2}" clone1/.git/post-checkout.args) && |
| 54 | + flag=$(awk "{print \$3}" clone1/.git/post-checkout.args) && |
| 55 | + test $old = $new -a $flag = 1 |
56 | 56 | ' |
57 | 57 |
|
58 | 58 | test_expect_success 'post-checkout receives the right args with HEAD changed ' ' |
59 | | - GIT_DIR=clone2/.git git checkout new2 && |
60 | | - old=$(awk "{print \$1}" clone2/.git/post-checkout.args) && |
61 | | - new=$(awk "{print \$2}" clone2/.git/post-checkout.args) && |
62 | | - flag=$(awk "{print \$3}" clone2/.git/post-checkout.args) && |
63 | | - test $old != $new -a $flag = 1 |
| 59 | + GIT_DIR=clone2/.git git checkout new2 && |
| 60 | + old=$(awk "{print \$1}" clone2/.git/post-checkout.args) && |
| 61 | + new=$(awk "{print \$2}" clone2/.git/post-checkout.args) && |
| 62 | + flag=$(awk "{print \$3}" clone2/.git/post-checkout.args) && |
| 63 | + test $old != $new -a $flag = 1 |
64 | 64 | ' |
65 | 65 |
|
66 | 66 | test_expect_success 'post-checkout receives the right args when not switching branches ' ' |
67 | | - GIT_DIR=clone2/.git git checkout master b && |
68 | | - old=$(awk "{print \$1}" clone2/.git/post-checkout.args) && |
69 | | - new=$(awk "{print \$2}" clone2/.git/post-checkout.args) && |
70 | | - flag=$(awk "{print \$3}" clone2/.git/post-checkout.args) && |
71 | | - test $old = $new -a $flag = 0 |
| 67 | + GIT_DIR=clone2/.git git checkout master b && |
| 68 | + old=$(awk "{print \$1}" clone2/.git/post-checkout.args) && |
| 69 | + new=$(awk "{print \$2}" clone2/.git/post-checkout.args) && |
| 70 | + flag=$(awk "{print \$3}" clone2/.git/post-checkout.args) && |
| 71 | + test $old = $new -a $flag = 0 |
72 | 72 | ' |
73 | 73 |
|
74 | 74 | if test "$(git config --bool core.filemode)" = true; then |
|
0 commit comments