@@ -30,40 +30,38 @@ test_expect_success 'set up basic repos' '
30
30
>bar &&
31
31
git add foo &&
32
32
test_tick &&
33
- git config i18n.commitEncoding $test_encoding &&
33
+ test_config i18n.commitEncoding $test_encoding &&
34
34
commit_msg $test_encoding | git commit -F - &&
35
35
git add bar &&
36
36
test_tick &&
37
- git commit -m "add bar" &&
38
- git config --unset i18n.commitEncoding
37
+ git commit -m "add bar"
39
38
'
40
39
41
40
test_expect_success ' alias builtin format' '
42
41
git log --pretty=oneline >expected &&
43
- git config pretty.test-alias oneline &&
42
+ test_config pretty.test-alias oneline &&
44
43
git log --pretty=test-alias >actual &&
45
44
test_cmp expected actual
46
45
'
47
46
48
47
test_expect_success ' alias masking builtin format' '
49
48
git log --pretty=oneline >expected &&
50
- git config pretty.oneline "%H" &&
49
+ test_config pretty.oneline "%H" &&
51
50
git log --pretty=oneline >actual &&
52
51
test_cmp expected actual
53
52
'
54
53
55
54
test_expect_success ' alias user-defined format' '
56
55
git log --pretty="format:%h" >expected &&
57
- git config pretty.test-alias "format:%h" &&
56
+ test_config pretty.test-alias "format:%h" &&
58
57
git log --pretty=test-alias >actual &&
59
58
test_cmp expected actual
60
59
'
61
60
62
61
test_expect_success ' alias user-defined tformat with %s (ISO8859-1 encoding)' '
63
- git config i18n.logOutputEncoding $test_encoding &&
62
+ test_config i18n.logOutputEncoding $test_encoding &&
64
63
git log --oneline >expected-s &&
65
64
git log --pretty="tformat:%h %s" >actual-s &&
66
- git config --unset i18n.logOutputEncoding &&
67
65
test_cmp expected-s actual-s
68
66
'
69
67
@@ -75,34 +73,34 @@ test_expect_success 'alias user-defined tformat with %s (utf-8 encoding)' '
75
73
76
74
test_expect_success ' alias user-defined tformat' '
77
75
git log --pretty="tformat:%h" >expected &&
78
- git config pretty.test-alias "tformat:%h" &&
76
+ test_config pretty.test-alias "tformat:%h" &&
79
77
git log --pretty=test-alias >actual &&
80
78
test_cmp expected actual
81
79
'
82
80
83
81
test_expect_success ' alias non-existent format' '
84
- git config pretty.test-alias format-that-will-never-exist &&
82
+ test_config pretty.test-alias format-that-will-never-exist &&
85
83
test_must_fail git log --pretty=test-alias
86
84
'
87
85
88
86
test_expect_success ' alias of an alias' '
89
87
git log --pretty="tformat:%h" >expected &&
90
- git config pretty.test-foo "tformat:%h" &&
91
- git config pretty.test-bar test-foo &&
88
+ test_config pretty.test-foo "tformat:%h" &&
89
+ test_config pretty.test-bar test-foo &&
92
90
git log --pretty=test-bar >actual && test_cmp expected actual
93
91
'
94
92
95
93
test_expect_success ' alias masking an alias' '
96
94
git log --pretty=format:"Two %H" >expected &&
97
- git config pretty.duplicate "format:One %H" &&
98
- git config --add pretty.duplicate "format:Two %H" &&
95
+ test_config pretty.duplicate "format:One %H" &&
96
+ test_config pretty.duplicate "format:Two %H" --add &&
99
97
git log --pretty=duplicate >actual &&
100
98
test_cmp expected actual
101
99
'
102
100
103
101
test_expect_success ' alias loop' '
104
- git config pretty.test-foo test-bar &&
105
- git config pretty.test-bar test-foo &&
102
+ test_config pretty.test-foo test-bar &&
103
+ test_config pretty.test-bar test-foo &&
106
104
test_must_fail git log --pretty=test-foo
107
105
'
108
106
0 commit comments