@ -386,6 +386,15 @@ test_expect_success 'later options override earlier options:' '
@@ -386,6 +386,15 @@ test_expect_success 'later options override earlier options:' '
test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC
'
test_expect_success 'non-defaults in config overridden by explicit defaults on command line' '
git -c diff.dirstat=files,cumulative,50 diff --dirstat=changes,noncumulative,3 HEAD^..HEAD >actual_diff_dirstat &&
test_cmp expect_diff_dirstat actual_diff_dirstat &&
git -c diff.dirstat=files,cumulative,50 diff --dirstat=changes,noncumulative,3 -M HEAD^..HEAD >actual_diff_dirstat_M &&
test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
git -c diff.dirstat=files,cumulative,50 diff --dirstat=changes,noncumulative,3 -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC
'
cat <<EOF >expect_diff_dirstat
2.1% changed/
10.8% dst/copy/changed/
@ -437,6 +446,15 @@ test_expect_success '-X0' '
@@ -437,6 +446,15 @@ test_expect_success '-X0' '
test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC
'
test_expect_success 'diff.dirstat=0' '
git -c diff.dirstat=0 diff --dirstat HEAD^..HEAD >actual_diff_dirstat &&
test_cmp expect_diff_dirstat actual_diff_dirstat &&
git -c diff.dirstat=0 diff --dirstat -M HEAD^..HEAD >actual_diff_dirstat_M &&
test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
git -c diff.dirstat=0 diff --dirstat -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC
'
cat <<EOF >expect_diff_dirstat
2.1% changed/
10.8% dst/copy/changed/
@ -507,6 +525,24 @@ test_expect_success '-X0,cumulative' '
@@ -507,6 +525,24 @@ test_expect_success '-X0,cumulative' '
test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC
'
test_expect_success 'diff.dirstat=0,cumulative' '
git -c diff.dirstat=0,cumulative diff --dirstat HEAD^..HEAD >actual_diff_dirstat &&
test_cmp expect_diff_dirstat actual_diff_dirstat &&
git -c diff.dirstat=0,cumulative diff --dirstat -M HEAD^..HEAD >actual_diff_dirstat_M &&
test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
git -c diff.dirstat=0,cumulative diff --dirstat -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC
'
test_expect_success 'diff.dirstat=0 & --dirstat=cumulative' '
git -c diff.dirstat=0 diff --dirstat=cumulative HEAD^..HEAD >actual_diff_dirstat &&
test_cmp expect_diff_dirstat actual_diff_dirstat &&
git -c diff.dirstat=0 diff --dirstat=cumulative -M HEAD^..HEAD >actual_diff_dirstat_M &&
test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
git -c diff.dirstat=0 diff --dirstat=cumulative -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC
'
cat <<EOF >expect_diff_dirstat
9.0% changed/
9.0% dst/copy/changed/
@ -558,6 +594,15 @@ test_expect_success '--dirstat=files' '
@@ -558,6 +594,15 @@ test_expect_success '--dirstat=files' '
test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC
'
test_expect_success 'diff.dirstat=files' '
git -c diff.dirstat=files diff --dirstat HEAD^..HEAD >actual_diff_dirstat &&
test_cmp expect_diff_dirstat actual_diff_dirstat &&
git -c diff.dirstat=files diff --dirstat -M HEAD^..HEAD >actual_diff_dirstat_M &&
test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
git -c diff.dirstat=files diff --dirstat -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC
'
cat <<EOF >expect_diff_dirstat
27.2% dst/copy/
27.2% dst/move/
@ -601,6 +646,15 @@ test_expect_success '--dirstat=files,10' '
@@ -601,6 +646,15 @@ test_expect_success '--dirstat=files,10' '
test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC
'
test_expect_success 'diff.dirstat=10,files' '
git -c diff.dirstat=10,files diff --dirstat HEAD^..HEAD >actual_diff_dirstat &&
test_cmp expect_diff_dirstat actual_diff_dirstat &&
git -c diff.dirstat=10,files diff --dirstat -M HEAD^..HEAD >actual_diff_dirstat_M &&
test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
git -c diff.dirstat=10,files diff --dirstat -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC
'
cat <<EOF >expect_diff_dirstat
9.0% changed/
9.0% dst/copy/changed/
@ -662,6 +716,15 @@ test_expect_success '--dirstat=files,cumulative' '
@@ -662,6 +716,15 @@ test_expect_success '--dirstat=files,cumulative' '
test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC
'
test_expect_success 'diff.dirstat=cumulative,files' '
git -c diff.dirstat=cumulative,files diff --dirstat HEAD^..HEAD >actual_diff_dirstat &&
test_cmp expect_diff_dirstat actual_diff_dirstat &&
git -c diff.dirstat=cumulative,files diff --dirstat -M HEAD^..HEAD >actual_diff_dirstat_M &&
test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
git -c diff.dirstat=cumulative,files diff --dirstat -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC
'
cat <<EOF >expect_diff_dirstat
27.2% dst/copy/
27.2% dst/move/
@ -703,4 +766,13 @@ test_expect_success '--dirstat=files,cumulative,10' '
@@ -703,4 +766,13 @@ test_expect_success '--dirstat=files,cumulative,10' '
test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC
'
test_expect_success 'diff.dirstat=10,cumulative,files' '
git -c diff.dirstat=10,cumulative,files diff --dirstat HEAD^..HEAD >actual_diff_dirstat &&
test_cmp expect_diff_dirstat actual_diff_dirstat &&
git -c diff.dirstat=10,cumulative,files diff --dirstat -M HEAD^..HEAD >actual_diff_dirstat_M &&
test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
git -c diff.dirstat=10,cumulative,files diff --dirstat -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC
'
test_done