839
test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC
840
'
841
842
+cat <<EOF >expect_diff_dirstat
843
+ 10.6% dst/copy/changed/
844
+ 10.6% dst/copy/rearranged/
845
+ 10.6% dst/copy/unchanged/
846
+ 10.6% dst/move/changed/
847
+ 10.6% dst/move/rearranged/
848
+ 10.6% dst/move/unchanged/
849
+ 10.6% src/move/changed/
850
+ 10.6% src/move/rearranged/
851
+ 10.6% src/move/unchanged/
852
+EOF
853
+
854
+cat <<EOF >expect_diff_dirstat_M
855
+ 5.2% changed/
856
+ 26.3% dst/copy/changed/
857
+ 26.3% dst/copy/rearranged/
858
+ 26.3% dst/copy/unchanged/
859
+ 5.2% dst/move/changed/
860
+ 5.2% dst/move/rearranged/
861
+ 5.2% rearranged/
862
+EOF
863
+
864
+cat <<EOF >expect_diff_dirstat_CC
865
+ 16.6% changed/
866
+ 16.6% dst/copy/changed/
867
+ 16.6% dst/copy/rearranged/
868
+ 16.6% dst/move/changed/
869
+ 16.6% dst/move/rearranged/
870
+ 16.6% rearranged/
871
+EOF
872
+
873
+test_expect_success '--dirstat=lines' '
874
+ git diff --dirstat=lines HEAD^..HEAD >actual_diff_dirstat &&
875
+ test_cmp expect_diff_dirstat actual_diff_dirstat &&
876
+ git diff --dirstat=lines -M HEAD^..HEAD >actual_diff_dirstat_M &&
877
+ test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
878
+ git diff --dirstat=lines -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
879
+ test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC
880
+'
881
+
882
+test_expect_success 'diff.dirstat=lines' '
883
+ git -c diff.dirstat=lines diff --dirstat HEAD^..HEAD >actual_diff_dirstat &&
884
+ test_cmp expect_diff_dirstat actual_diff_dirstat &&
885
+ git -c diff.dirstat=lines diff --dirstat -M HEAD^..HEAD >actual_diff_dirstat_M &&
886
+ test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
887
+ git -c diff.dirstat=lines diff --dirstat -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
888
+ test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC
889
+'
890
+
891
+cat <<EOF >expect_diff_dirstat
892
+ 2.1% changed/
893
+ 10.6% dst/copy/changed/
894
+ 10.6% dst/copy/rearranged/
895
+ 10.6% dst/copy/unchanged/
896
+ 10.6% dst/move/changed/
897
+ 10.6% dst/move/rearranged/
898
+ 10.6% dst/move/unchanged/
899
+ 2.1% rearranged/
900
+ 10.6% src/move/changed/
901
+ 10.6% src/move/rearranged/
902
+ 10.6% src/move/unchanged/
903
+EOF
904
+
905
+cat <<EOF >expect_diff_dirstat_M
906
+ 5.2% changed/
907
+ 26.3% dst/copy/changed/
908
+ 26.3% dst/copy/rearranged/
909
+ 26.3% dst/copy/unchanged/
910
+ 5.2% dst/move/changed/
911
+ 5.2% dst/move/rearranged/
912
+ 5.2% rearranged/
913
+EOF
914
+
915
+cat <<EOF >expect_diff_dirstat_CC
916
+ 16.6% changed/
917
+ 16.6% dst/copy/changed/
918
+ 16.6% dst/copy/rearranged/
919
+ 16.6% dst/move/changed/
920
+ 16.6% dst/move/rearranged/
921
+ 16.6% rearranged/
922
+EOF
923
+
924
+test_expect_success '--dirstat=lines,0' '
925
+ git diff --dirstat=lines,0 HEAD^..HEAD >actual_diff_dirstat &&
926
+ test_cmp expect_diff_dirstat actual_diff_dirstat &&
927
+ git diff --dirstat=lines,0 -M HEAD^..HEAD >actual_diff_dirstat_M &&
928
+ test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
929
+ git diff --dirstat=lines,0 -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
930
+ test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC
931
+'
932
+
933
+test_expect_success 'diff.dirstat=0,lines' '
934
+ git -c diff.dirstat=0,lines diff --dirstat HEAD^..HEAD >actual_diff_dirstat &&
935
+ test_cmp expect_diff_dirstat actual_diff_dirstat &&
936
+ git -c diff.dirstat=0,lines diff --dirstat -M HEAD^..HEAD >actual_diff_dirstat_M &&
937
+ test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
938
+ git -c diff.dirstat=0,lines diff --dirstat -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
939
+ test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC
940
+'
941
+
942
test_done