@matheusbsbs / matheus-bagliano / commits / bd886fd3ea
Fork 0

t1300-repo-config: two new config parsing tests.

- correctly insert a new variable into a section that only contains a single (different) variable. - correctly insert a new section that matches the initial substring of an existing section. Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca> Signed-off-by: Junio C Hamano <junkio@cox.net>

sean committed May 6, 2006 at 15:43 UTC bd886fd3ea49b726493255d4adf5d20b31681713
1 file changed +31
t/t1300-repo-config.sh
+31
@@ -278,5 +278,36 @@ git-repo-config > output 2>&1
278 test_expect_success 'no arguments, but no crash' \
279 "test $? = 129 && grep usage output"
280
281 +cat > .git/config << EOF
282 +[a.b]
283 + c = d
284 +EOF
285 +
286 +git-repo-config a.x y
287 +
288 +cat > expect << EOF
289 +[a.b]
290 + c = d
291 +[a]
292 + x = y
293 +EOF
294 +
295 +test_expect_success 'new section is partial match of another' 'cmp .git/config expect'
296 +
297 +git-repo-config b.x y
298 +git-repo-config a.b c
299 +
300 +cat > expect << EOF
301 +[a.b]
302 + c = d
303 +[a]
304 + x = y
305 + b = c
306 +[b]
307 + x = y
308 +EOF
309 +
310 +test_expect_success 'new variable inserts into proper section' 'cmp .git/config expect'
311 +
312 test_done
313