25
26
test_expect_success 'plain' '
27
(
28
- sane_unset GIT_DIR GIT_WORK_TREE &&
28
mkdir plain &&
29
cd plain &&
30
git init
34
35
test_expect_success 'plain nested in bare' '
36
(
38
- sane_unset GIT_DIR GIT_WORK_TREE &&
37
git init --bare bare-ancestor.git &&
38
cd bare-ancestor.git &&
39
mkdir plain-nested &&
45
46
test_expect_success 'plain through aliased command, outside any git repo' '
47
(
50
- sane_unset GIT_DIR GIT_WORK_TREE &&
48
HOME=$(pwd)/alias-config &&
49
export HOME &&
50
mkdir alias-config &&
62
63
test_expect_failure 'plain nested through aliased command' '
64
(
68
- sane_unset GIT_DIR GIT_WORK_TREE &&
65
git init plain-ancestor-aliased &&
66
cd plain-ancestor-aliased &&
67
echo "[alias] aliasedinit = init" >>.git/config &&
74
75
test_expect_failure 'plain nested in bare through aliased command' '
76
(
81
- sane_unset GIT_DIR GIT_WORK_TREE &&
77
git init --bare bare-ancestor-aliased.git &&
78
cd bare-ancestor-aliased.git &&
79
echo "[alias] aliasedinit = init" >>config &&
86
87
test_expect_success 'plain with GIT_WORK_TREE' '
88
if (
94
- sane_unset GIT_DIR &&
89
mkdir plain-wt &&
90
cd plain-wt &&
91
GIT_WORK_TREE=$(pwd) git init
98
99
test_expect_success 'plain bare' '
100
(
107
- sane_unset GIT_DIR GIT_WORK_TREE GIT_CONFIG &&
101
mkdir plain-bare-1 &&
102
cd plain-bare-1 &&
103
git --bare init
107
108
test_expect_success 'plain bare with GIT_WORK_TREE' '
109
if (
117
- sane_unset GIT_DIR GIT_CONFIG &&
110
mkdir plain-bare-2 &&
111
cd plain-bare-2 &&
112
GIT_WORK_TREE=$(pwd) git --bare init
120
test_expect_success 'GIT_DIR bare' '
121
122
(
131
- sane_unset GIT_CONFIG &&
123
mkdir git-dir-bare.git &&
124
GIT_DIR=git-dir-bare.git git init
125
) &&
129
test_expect_success 'init --bare' '
130
131
(
141
- sane_unset GIT_DIR GIT_WORK_TREE GIT_CONFIG &&
132
mkdir init-bare.git &&
133
cd init-bare.git &&
134
git init --bare
139
test_expect_success 'GIT_DIR non-bare' '
140
141
(
152
- sane_unset GIT_CONFIG &&
142
mkdir non-bare &&
143
cd non-bare &&
144
GIT_DIR=.git git init
149
test_expect_success 'GIT_DIR & GIT_WORK_TREE (1)' '
150
151
(
163
- sane_unset GIT_CONFIG &&
152
mkdir git-dir-wt-1.git &&
153
GIT_WORK_TREE=$(pwd) GIT_DIR=git-dir-wt-1.git git init
154
) &&
158
test_expect_success 'GIT_DIR & GIT_WORK_TREE (2)' '
159
160
if (
173
- sane_unset GIT_CONFIG &&
161
mkdir git-dir-wt-2.git &&
162
GIT_WORK_TREE=$(pwd) GIT_DIR=git-dir-wt-2.git git --bare init
163
)
170
test_expect_success 'reinit' '
171
172
(
186
- sane_unset GIT_CONFIG GIT_WORK_TREE GIT_CONFIG &&
187
-
173
mkdir again &&
174
cd again &&
175
git init >out1 2>err1 &&