@@ -30,40 +30,46 @@ 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
61
+ test_expect_success ' alias user-defined format is matched case-insensitively' '
62
+ git log --pretty="format:%h" >expected &&
63
+ test_config pretty.testone "format:%h" &&
64
+ test_config pretty.testtwo testOne &&
65
+ git log --pretty=testTwo >actual &&
66
+ test_cmp expected actual
67
+ '
68
+
62
69
test_expect_success ' alias user-defined tformat with %s (ISO8859-1 encoding)' '
63
- git config i18n.logOutputEncoding $test_encoding &&
70
+ test_config i18n.logOutputEncoding $test_encoding &&
64
71
git log --oneline >expected-s &&
65
72
git log --pretty="tformat:%h %s" >actual-s &&
66
- git config --unset i18n.logOutputEncoding &&
67
73
test_cmp expected-s actual-s
68
74
'
69
75
@@ -75,34 +81,34 @@ test_expect_success 'alias user-defined tformat with %s (utf-8 encoding)' '
75
81
76
82
test_expect_success ' alias user-defined tformat' '
77
83
git log --pretty="tformat:%h" >expected &&
78
- git config pretty.test-alias "tformat:%h" &&
84
+ test_config pretty.test-alias "tformat:%h" &&
79
85
git log --pretty=test-alias >actual &&
80
86
test_cmp expected actual
81
87
'
82
88
83
89
test_expect_success ' alias non-existent format' '
84
- git config pretty.test-alias format-that-will-never-exist &&
90
+ test_config pretty.test-alias format-that-will-never-exist &&
85
91
test_must_fail git log --pretty=test-alias
86
92
'
87
93
88
94
test_expect_success ' alias of an alias' '
89
95
git log --pretty="tformat:%h" >expected &&
90
- git config pretty.test-foo "tformat:%h" &&
91
- git config pretty.test-bar test-foo &&
96
+ test_config pretty.test-foo "tformat:%h" &&
97
+ test_config pretty.test-bar test-foo &&
92
98
git log --pretty=test-bar >actual && test_cmp expected actual
93
99
'
94
100
95
101
test_expect_success ' alias masking an alias' '
96
102
git log --pretty=format:"Two %H" >expected &&
97
- git config pretty.duplicate "format:One %H" &&
98
- git config --add pretty.duplicate "format:Two %H" &&
103
+ test_config pretty.duplicate "format:One %H" &&
104
+ test_config pretty.duplicate "format:Two %H" --add &&
99
105
git log --pretty=duplicate >actual &&
100
106
test_cmp expected actual
101
107
'
102
108
103
109
test_expect_success ' alias loop' '
104
- git config pretty.test-foo test-bar &&
105
- git config pretty.test-bar test-foo &&
110
+ test_config pretty.test-foo test-bar &&
111
+ test_config pretty.test-bar test-foo &&
106
112
test_must_fail git log --pretty=test-foo
107
113
'
108
114
0 commit comments