Merge branch 'ta/config-set'
authorJunio C Hamano <gitster@pobox.com>
Mon, 20 Oct 2014 19:23:42 +0000 (12:23 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 20 Oct 2014 19:23:43 +0000 (12:23 -0700)
* ta/config-set:
t1308: fix broken here document in test script

1  2 
t/t1308-config-set.sh
diff --combined t/t1308-config-set.sh
index ea0bce2dc64b6fe3cac3e00f48b7a17a341af647,243d6120a2d8fb207002e6107993f7f602a55fb5..91235b76ba76f7e7e9338e37da7106eb550969e6
@@@ -23,7 -23,7 +23,7 @@@ check_config () 
  }
  
  test_expect_success 'setup default config' '
-       cat >.git/config <<\EOF
+       cat >.git/config <<-\EOF
        [case]
                penguin = very blue
                Movie = BadPhysics
@@@ -119,16 -119,6 +119,16 @@@ test_expect_success 'find integer valu
        check_config get_int lamb.chop 65
  '
  
 +test_expect_success 'find string value for a key' '
 +      check_config get_string case.baz hask &&
 +      check_config expect_code 1 get_string case.ba "Value not found for \"case.ba\""
 +'
 +
 +test_expect_success 'check line error when NULL string is queried' '
 +      test_expect_code 128 test-config get_string case.foo 2>result &&
 +      test_i18ngrep "fatal: .*case\.foo.*\.git/config.*line 7" result
 +'
 +
  test_expect_success 'find integer if value is non parse-able' '
        check_config expect_code 128 get_int lamb.head
  '
@@@ -195,7 -185,7 +195,7 @@@ test_expect_success 'proper error on er
        cp .git/config .git/config.old &&
        test_when_finished "mv .git/config.old .git/config" &&
        echo "[" >>.git/config &&
-       echo "fatal: bad config file line 35 in .git/config" >expect &&
+       echo "fatal: bad config file line 34 in .git/config" >expect &&
        test_expect_code 128 test-config get_value foo.bar 2>actual &&
        test_cmp expect actual
  '
@@@ -207,15 -197,4 +207,15 @@@ test_expect_success 'proper error on er
        test_cmp expect actual
  '
  
 +test_expect_success 'check line errors for malformed values' '
 +      mv .git/config .git/config.old &&
 +      test_when_finished "mv .git/config.old .git/config" &&
 +      cat >.git/config <<-\EOF &&
 +      [alias]
 +              br
 +      EOF
 +      test_expect_code 128 git br 2>result &&
 +      test_i18ngrep "fatal: .*alias\.br.*\.git/config.*line 2" result
 +'
 +
  test_done