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 <lukeshu@datawire.io> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Luke Shumaker committed Apr 27, 2021 at 15:17 UTC db6952b2b28627d43da5e0fdaefcea6c040ab581
1 file changed +13 -13
contrib/subtree/t/t7900-subtree.sh
+13 -13
@@ -33,7 +33,7 @@ test_create_commit () (
33 git commit -m "$commit" || error "Could not commit"
34 )
35
36 -last_commit_message () {
36 +last_commit_subject () {
37 git log --pretty=format:%s -1
38 }
39
@@ -74,7 +74,7 @@ test_expect_success 'add subproj as subtree into sub dir/ with --prefix' '
74 cd "$test_count" &&
75 git fetch ./"sub proj" HEAD &&
76 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)'\''"
78 )
79 '
80
@@ -87,7 +87,7 @@ test_expect_success 'add subproj as subtree into sub dir/ with --prefix and --me
87 cd "$test_count" &&
88 git fetch ./"sub proj" HEAD &&
89 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"
91 )
92 '
93
@@ -100,7 +100,7 @@ test_expect_success 'add subproj as subtree into sub dir/ with --prefix as -P an
100 cd "$test_count" &&
101 git fetch ./"sub proj" HEAD &&
102 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"
104 )
105 '
106
@@ -113,7 +113,7 @@ test_expect_success 'add subproj as subtree into sub dir/ with --squash and --pr
113 cd "$test_count" &&
114 git fetch ./"sub proj" HEAD &&
115 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"
117 )
118 '
119
@@ -136,7 +136,7 @@ test_expect_success 'merge new subproj history into sub dir/ with --prefix' '
136 cd "$test_count" &&
137 git fetch ./"sub proj" HEAD &&
138 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)'\''"
140 )
141 '
142
@@ -155,7 +155,7 @@ test_expect_success 'merge new subproj history into sub dir/ with --prefix and -
155 cd "$test_count" &&
156 git fetch ./"sub proj" HEAD &&
157 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"
159 )
160 '
161
@@ -174,7 +174,7 @@ test_expect_success 'merge new subproj history into sub dir/ with --squash and -
174 cd "$test_count" &&
175 git fetch ./"sub proj" HEAD &&
176 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"
178 )
179 '
180
@@ -209,7 +209,7 @@ test_expect_success 'merge new subproj history into subdir/ with a slash appende
209 cd "$test_count" &&
210 git fetch ./subproj HEAD &&
211 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)'\''"
213 )
214 '
215
@@ -275,7 +275,7 @@ test_expect_success 'split sub dir/ with --rejoin' '
275 git subtree merge --prefix="sub dir" FETCH_HEAD &&
276 split_hash=$(git subtree split --prefix="sub dir" --annotate="*") &&
277 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'\''"
279 )
280 '
281
@@ -290,7 +290,7 @@ test_expect_success 'split sub dir/ with --rejoin from scratch' '
290 git commit -m"sub dir file" &&
291 split_hash=$(git subtree split --prefix="sub dir" --rejoin) &&
292 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'\''"
294 )
295 '
296
@@ -313,7 +313,7 @@ test_expect_success 'split sub dir/ with --rejoin and --message' '
313 git fetch ./"sub proj" HEAD &&
314 git subtree merge --prefix="sub dir" FETCH_HEAD &&
315 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"
317 )
318 '
319
@@ -878,7 +878,7 @@ test_expect_success 'push split to subproj' '
878 git subtree push ./"sub proj" --prefix "sub dir" sub-branch-1 &&
879 cd ./"sub proj" &&
880 git checkout sub-branch-1 &&
881 - test "$(last_commit_message)" = "sub dir/main-sub3"
881 + test "$(last_commit_subject)" = "sub dir/main-sub3"
882 )
883 '
884