Skip to content

Commit 6fa18ab

Browse files
authored
test(commit split): fix for Git 2.52 (#961)
Prompt for 'git add -p' changed in Git 2.52, so tests are now failing. Update the fixtures and skip these tests on older Git versions.
1 parent ec81e5e commit 6fa18ab

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

testdata/script/commit_split.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Basic 'commit split' usage.
22

33
[!unix] skip # pending github.com/creack/pty/pull/155
4+
[!git:2.52] skip # git add -p output is fixed to Git version
45

56
as 'Test <test@example.com>'
67
at '2024-07-08T05:04:32Z'
@@ -59,7 +60,7 @@ index 0000000..b30fa09
5960
@@ -0,0 +1,2 @@
6061
+feature 1
6162
+
62-
(1/1) Apply addition to index [y,n,q,a,d,e,p,?]?
63+
(1/1) Apply addition to index [y,n,q,a,d,e,p,P,?]?
6364
### second ###
6465
INF Select hunks to extract into a new commit
6566
diff --git b/feature1.txt a/feature1.txt
@@ -70,7 +71,7 @@ index 0000000..b30fa09
7071
@@ -0,0 +1,2 @@
7172
+feature 1
7273
+
73-
(1/1) Apply addition to index [y,n,q,a,d,e,p,?]? y
74+
(1/1) Apply addition to index [y,n,q,a,d,e,p,P,?]? y
7475

7576
diff --git b/feature2.txt a/feature2.txt
7677
new file mode 100644
@@ -80,7 +81,7 @@ index 0000000..4357a3d
8081
@@ -0,0 +1,2 @@
8182
+feature 2
8283
+
83-
(1/1) Apply addition to index [y,n,q,a,d,e,p,?]?
84+
(1/1) Apply addition to index [y,n,q,a,d,e,p,P,?]?
8485
### exit ###
8586
INF Select hunks to extract into a new commit
8687
diff --git b/feature1.txt a/feature1.txt
@@ -91,7 +92,7 @@ index 0000000..b30fa09
9192
@@ -0,0 +1,2 @@
9293
+feature 1
9394
+
94-
(1/1) Apply addition to index [y,n,q,a,d,e,p,?]? y
95+
(1/1) Apply addition to index [y,n,q,a,d,e,p,P,?]? y
9596

9697
diff --git b/feature2.txt a/feature2.txt
9798
new file mode 100644
@@ -101,7 +102,7 @@ index 0000000..4357a3d
101102
@@ -0,0 +1,2 @@
102103
+feature 2
103104
+
104-
(1/1) Apply addition to index [y,n,q,a,d,e,p,?]? q
105+
(1/1) Apply addition to index [y,n,q,a,d,e,p,P,?]? q
105106

106107
[features 5c5b54e] Add feature 1
107108
1 file changed, 2 insertions(+)

testdata/script/commit_split_no_verify.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Commit split with --no-verify.
22

33
[!unix] skip # pending github.com/creack/pty/pull/155
4+
[!git:2.52] skip # git add -p output is fixed to Git version
45

56
as 'Test <test@example.com>'
67
at '2024-07-08T05:04:32Z'
@@ -67,7 +68,7 @@ index 0000000..b30fa09
6768
@@ -0,0 +1,2 @@
6869
+feature 1
6970
+
70-
(1/1) Apply addition to index [y,n,q,a,d,e,p,?]?
71+
(1/1) Apply addition to index [y,n,q,a,d,e,p,P,?]?
7172
### second ###
7273
INF Select hunks to extract into a new commit
7374
diff --git b/feature1.txt a/feature1.txt
@@ -78,7 +79,7 @@ index 0000000..b30fa09
7879
@@ -0,0 +1,2 @@
7980
+feature 1
8081
+
81-
(1/1) Apply addition to index [y,n,q,a,d,e,p,?]? y
82+
(1/1) Apply addition to index [y,n,q,a,d,e,p,P,?]? y
8283

8384
diff --git b/feature2.txt a/feature2.txt
8485
new file mode 100644
@@ -88,7 +89,7 @@ index 0000000..4357a3d
8889
@@ -0,0 +1,2 @@
8990
+feature 2
9091
+
91-
(1/1) Apply addition to index [y,n,q,a,d,e,p,?]?
92+
(1/1) Apply addition to index [y,n,q,a,d,e,p,P,?]?
9293
### exit ###
9394
INF Select hunks to extract into a new commit
9495
diff --git b/feature1.txt a/feature1.txt
@@ -99,7 +100,7 @@ index 0000000..b30fa09
99100
@@ -0,0 +1,2 @@
100101
+feature 1
101102
+
102-
(1/1) Apply addition to index [y,n,q,a,d,e,p,?]? y
103+
(1/1) Apply addition to index [y,n,q,a,d,e,p,P,?]? y
103104

104105
diff --git b/feature2.txt a/feature2.txt
105106
new file mode 100644
@@ -109,7 +110,7 @@ index 0000000..4357a3d
109110
@@ -0,0 +1,2 @@
110111
+feature 2
111112
+
112-
(1/1) Apply addition to index [y,n,q,a,d,e,p,?]? q
113+
(1/1) Apply addition to index [y,n,q,a,d,e,p,P,?]? q
113114

114115
[features 5c5b54e] Add feature 1
115116
1 file changed, 2 insertions(+)

0 commit comments

Comments
 (0)