Skip to content

Commit db6952b

Browse files
LukeShugitster
authored andcommitted
subtree: t7900: rename last_commit_message to last_commit_subject
t7900-subtree.sh defines a helper function named last_commit_message. However, it only returns the subject line of the commit message, not the entire commit message. So rename it, to make the name less confusing. Signed-off-by: Luke Shumaker <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f1cd2d9 commit db6952b

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

contrib/subtree/t/t7900-subtree.sh

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ test_create_commit () (
3333
git commit -m "$commit" || error "Could not commit"
3434
)
3535

36-
last_commit_message () {
36+
last_commit_subject () {
3737
git log --pretty=format:%s -1
3838
}
3939

@@ -74,7 +74,7 @@ test_expect_success 'add subproj as subtree into sub dir/ with --prefix' '
7474
cd "$test_count" &&
7575
git fetch ./"sub proj" HEAD &&
7676
git subtree add --prefix="sub dir" FETCH_HEAD &&
77-
test "$(last_commit_message)" = "Add '\''sub dir/'\'' from commit '\''$(git rev-parse FETCH_HEAD)'\''"
77+
test "$(last_commit_subject)" = "Add '\''sub dir/'\'' from commit '\''$(git rev-parse FETCH_HEAD)'\''"
7878
)
7979
'
8080

@@ -87,7 +87,7 @@ test_expect_success 'add subproj as subtree into sub dir/ with --prefix and --me
8787
cd "$test_count" &&
8888
git fetch ./"sub proj" HEAD &&
8989
git subtree add --prefix="sub dir" --message="Added subproject" FETCH_HEAD &&
90-
test "$(last_commit_message)" = "Added subproject"
90+
test "$(last_commit_subject)" = "Added subproject"
9191
)
9292
'
9393

@@ -100,7 +100,7 @@ test_expect_success 'add subproj as subtree into sub dir/ with --prefix as -P an
100100
cd "$test_count" &&
101101
git fetch ./"sub proj" HEAD &&
102102
git subtree add -P "sub dir" -m "Added subproject" FETCH_HEAD &&
103-
test "$(last_commit_message)" = "Added subproject"
103+
test "$(last_commit_subject)" = "Added subproject"
104104
)
105105
'
106106

@@ -113,7 +113,7 @@ test_expect_success 'add subproj as subtree into sub dir/ with --squash and --pr
113113
cd "$test_count" &&
114114
git fetch ./"sub proj" HEAD &&
115115
git subtree add --prefix="sub dir" --message="Added subproject with squash" --squash FETCH_HEAD &&
116-
test "$(last_commit_message)" = "Added subproject with squash"
116+
test "$(last_commit_subject)" = "Added subproject with squash"
117117
)
118118
'
119119

@@ -136,7 +136,7 @@ test_expect_success 'merge new subproj history into sub dir/ with --prefix' '
136136
cd "$test_count" &&
137137
git fetch ./"sub proj" HEAD &&
138138
git subtree merge --prefix="sub dir" FETCH_HEAD &&
139-
test "$(last_commit_message)" = "Merge commit '\''$(git rev-parse FETCH_HEAD)'\''"
139+
test "$(last_commit_subject)" = "Merge commit '\''$(git rev-parse FETCH_HEAD)'\''"
140140
)
141141
'
142142

@@ -155,7 +155,7 @@ test_expect_success 'merge new subproj history into sub dir/ with --prefix and -
155155
cd "$test_count" &&
156156
git fetch ./"sub proj" HEAD &&
157157
git subtree merge --prefix="sub dir" --message="Merged changes from subproject" FETCH_HEAD &&
158-
test "$(last_commit_message)" = "Merged changes from subproject"
158+
test "$(last_commit_subject)" = "Merged changes from subproject"
159159
)
160160
'
161161

@@ -174,7 +174,7 @@ test_expect_success 'merge new subproj history into sub dir/ with --squash and -
174174
cd "$test_count" &&
175175
git fetch ./"sub proj" HEAD &&
176176
git subtree merge --prefix="sub dir" --message="Merged changes from subproject using squash" --squash FETCH_HEAD &&
177-
test "$(last_commit_message)" = "Merged changes from subproject using squash"
177+
test "$(last_commit_subject)" = "Merged changes from subproject using squash"
178178
)
179179
'
180180

@@ -209,7 +209,7 @@ test_expect_success 'merge new subproj history into subdir/ with a slash appende
209209
cd "$test_count" &&
210210
git fetch ./subproj HEAD &&
211211
git subtree merge --prefix=subdir/ FETCH_HEAD &&
212-
test "$(last_commit_message)" = "Merge commit '\''$(git rev-parse FETCH_HEAD)'\''"
212+
test "$(last_commit_subject)" = "Merge commit '\''$(git rev-parse FETCH_HEAD)'\''"
213213
)
214214
'
215215

@@ -275,7 +275,7 @@ test_expect_success 'split sub dir/ with --rejoin' '
275275
git subtree merge --prefix="sub dir" FETCH_HEAD &&
276276
split_hash=$(git subtree split --prefix="sub dir" --annotate="*") &&
277277
git subtree split --prefix="sub dir" --annotate="*" --rejoin &&
278-
test "$(last_commit_message)" = "Split '\''sub dir/'\'' into commit '\''$split_hash'\''"
278+
test "$(last_commit_subject)" = "Split '\''sub dir/'\'' into commit '\''$split_hash'\''"
279279
)
280280
'
281281

@@ -290,7 +290,7 @@ test_expect_success 'split sub dir/ with --rejoin from scratch' '
290290
git commit -m"sub dir file" &&
291291
split_hash=$(git subtree split --prefix="sub dir" --rejoin) &&
292292
git subtree split --prefix="sub dir" --rejoin &&
293-
test "$(last_commit_message)" = "Split '\''sub dir/'\'' into commit '\''$split_hash'\''"
293+
test "$(last_commit_subject)" = "Split '\''sub dir/'\'' into commit '\''$split_hash'\''"
294294
)
295295
'
296296

@@ -313,7 +313,7 @@ test_expect_success 'split sub dir/ with --rejoin and --message' '
313313
git fetch ./"sub proj" HEAD &&
314314
git subtree merge --prefix="sub dir" FETCH_HEAD &&
315315
git subtree split --prefix="sub dir" --message="Split & rejoin" --annotate="*" --rejoin &&
316-
test "$(last_commit_message)" = "Split & rejoin"
316+
test "$(last_commit_subject)" = "Split & rejoin"
317317
)
318318
'
319319

@@ -878,7 +878,7 @@ test_expect_success 'push split to subproj' '
878878
git subtree push ./"sub proj" --prefix "sub dir" sub-branch-1 &&
879879
cd ./"sub proj" &&
880880
git checkout sub-branch-1 &&
881-
test "$(last_commit_message)" = "sub dir/main-sub3"
881+
test "$(last_commit_subject)" = "sub dir/main-sub3"
882882
)
883883
'
884884

0 commit comments

Comments
 (0)