git commit -m broken &&
test_must_fail git config --blob=HEAD:config some.value 2>err &&
+ test_i18ngrep "HEAD:config" err
+'
+
+test_expect_success 'can parse blob ending with CR' '
+ printf "[some]key = value\\r" >config &&
+ git add config &&
+ git commit -m CR &&
+ echo value >expect &&
+ git config --blob=HEAD:config some.key >actual &&
+ test_cmp expect actual
+'
- # just grep for our token as the exact error message is likely to
- # change or be internationalized
- grep "HEAD:config" err
+test_expect_success 'config --blob outside of a repository is an error' '
+ test_must_fail nongit git config --blob=foo --list
'
test_done