f4e18cb8d3edf01d231976927943959244a4da3a
   1#!/bin/sh
   2#
   3# Copyright (c) Jim Meyering
   4#
   5test_description='diff honors config option, diff.suppressBlankEmpty'
   6
   7. ./test-lib.sh
   8
   9cat <<\EOF > exp ||
  10diff --git a/f b/f
  11index 5f6a263..8cb8bae 100644
  12--- a/f
  13+++ b/f
  14@@ -1,2 +1,2 @@
  15
  16-x
  17+y
  18EOF
  19exit 1
  20
  21test_expect_success "$test_description" '
  22        printf "\nx\n" > f &&
  23        git add f &&
  24        git commit -q -m. f &&
  25        printf "\ny\n" > f &&
  26        git config --bool diff.suppressBlankEmpty true &&
  27        git diff f > actual &&
  28        test_cmp exp actual &&
  29        perl -i.bak -p -e "s/^\$/ /" exp &&
  30        git config --bool diff.suppressBlankEmpty false &&
  31        git diff f > actual &&
  32        test_cmp exp actual &&
  33        git config --bool --unset diff.suppressBlankEmpty &&
  34        git diff f > actual &&
  35        test_cmp exp actual
  36'
  37
  38test_done