Skip to content

Commit cf4f054

Browse files
committed
t1312: create read/write test
This new test will be extended in the future to ensure that multiple commands that execute in order update the configuration state enough to reflect new written values as we read them in later commands. Signed-off-by: Derrick Stolee <stolee@gmail.com>
1 parent fdeef53 commit cf4f054

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

t/t1312-config-batch.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,4 +295,31 @@ test_expect_success 'set config by scope with -z' '
295295
test_cmp expect-values values
296296
'
297297

298+
test_expect_success 'read/write interactions in sequence' '
299+
test_when_finished git config remove-section test.rw &&
300+
301+
cat >in <<-\EOF &&
302+
get 1 local test.rw.missing
303+
set 1 local test.rw.found found
304+
get 1 local test.rw.found
305+
set 1 local test.rw.found updated
306+
get 1 local test.rw.found
307+
EOF
308+
309+
cat >expect <<-\EOF &&
310+
get 1 missing test.rw.missing
311+
set 1 success local test.rw.found found
312+
get 1 found test.rw.found local found
313+
set 1 success local test.rw.found updated
314+
get 1 found test.rw.found local updated
315+
EOF
316+
317+
git config-batch <in >out 2>err &&
318+
319+
test_must_be_empty err &&
320+
test_cmp expect out &&
321+
322+
test_cmp_config updated test.rw.found
323+
'
324+
298325
test_done

0 commit comments

Comments
 (0)