t7900-subtree.sh defines its own `check_equal A B` function, instead of
just using `test A = B` like all of the other tests. Don't be special,
get rid of `check_equal` in favor of `test`.
Signed-off-by: Luke Shumaker <lukeshu@datawire.io>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Luke Shumaker4 years agocommitted byJunio C Hamano
@ -123,7 +111,7 @@ test_expect_success 'add subproj as subtree into sub dir/ with --prefix' '
@@ -123,7 +111,7 @@ test_expect_success 'add subproj as subtree into sub dir/ with --prefix' '
cd "$test_count" &&
git fetch ./"sub proj" HEAD &&
git subtree add --prefix="sub dir" FETCH_HEAD &&
check_equal "$(last_commit_message)" "Add '\''sub dir/'\'' from commit '\''$(git rev-parse FETCH_HEAD)'\''"
test "$(last_commit_message)" = "Add '\''sub dir/'\'' from commit '\''$(git rev-parse FETCH_HEAD)'\''"
)
'
@ -136,7 +124,7 @@ test_expect_success 'add subproj as subtree into sub dir/ with --prefix and --me
@@ -136,7 +124,7 @@ test_expect_success 'add subproj as subtree into sub dir/ with --prefix and --me
test "$(last_commit_message)" = "Added subproject"
)
'
@ -149,7 +137,7 @@ test_expect_success 'add subproj as subtree into sub dir/ with --prefix as -P an
@@ -149,7 +137,7 @@ test_expect_success 'add subproj as subtree into sub dir/ with --prefix as -P an
test "$(last_commit_message)" = "Added subproject"
)
'
@ -162,7 +150,7 @@ test_expect_success 'add subproj as subtree into sub dir/ with --squash and --pr
@@ -162,7 +150,7 @@ test_expect_success 'add subproj as subtree into sub dir/ with --squash and --pr
check_equal "$(last_commit_message)" "Added subproject with squash"
test "$(last_commit_message)" = "Added subproject with squash"
)
'
@ -185,7 +173,7 @@ test_expect_success 'merge new subproj history into sub dir/ with --prefix' '
@@ -185,7 +173,7 @@ test_expect_success 'merge new subproj history into sub dir/ with --prefix' '
test "$(last_commit_message)" = "Merge commit '\''$(git rev-parse FETCH_HEAD)'\''"
)
'
@ -204,7 +192,7 @@ test_expect_success 'merge new subproj history into sub dir/ with --prefix and -
@@ -204,7 +192,7 @@ test_expect_success 'merge new subproj history into sub dir/ with --prefix and -
check_equal "$(last_commit_message)" "Merged changes from subproject"
test "$(last_commit_message)" = "Merged changes from subproject"
)
'
@ -223,7 +211,7 @@ test_expect_success 'merge new subproj history into sub dir/ with --squash and -
@@ -223,7 +211,7 @@ test_expect_success 'merge new subproj history into sub dir/ with --squash and -
cd "$test_count" &&
git fetch ./"sub proj" HEAD &&
git subtree merge --prefix="sub dir" --message="Merged changes from subproject using squash" --squash FETCH_HEAD &&
check_equal "$(last_commit_message)" "Merged changes from subproject using squash"
test "$(last_commit_message)" = "Merged changes from subproject using squash"
)
'
@ -239,7 +227,7 @@ test_expect_success 'merge the added subproj again, should do nothing' '
@@ -239,7 +227,7 @@ test_expect_success 'merge the added subproj again, should do nothing' '
# this shouldn not actually do anything, since FETCH_HEAD
@ -258,7 +246,7 @@ test_expect_success 'merge new subproj history into subdir/ with a slash appende
@@ -258,7 +246,7 @@ test_expect_success 'merge new subproj history into subdir/ with a slash appende
check_equal "$(last_commit_message)" "Split '\''sub dir/'\'' into commit '\''$split_hash'\''"
test "$(last_commit_message)" = "Split '\''sub dir/'\'' into commit '\''$split_hash'\''"
)
'
@ -339,7 +327,7 @@ test_expect_success 'split sub dir/ with --rejoin from scratch' '
@@ -339,7 +327,7 @@ test_expect_success 'split sub dir/ with --rejoin from scratch' '
check_equal "$(last_commit_message)" "Split '\''sub dir/'\'' into commit '\''$split_hash'\''"
test "$(last_commit_message)" = "Split '\''sub dir/'\'' into commit '\''$split_hash'\''"
)
'
@ -362,7 +350,7 @@ test_expect_success 'split sub dir/ with --rejoin and --message' '
@@ -362,7 +350,7 @@ test_expect_success 'split sub dir/ with --rejoin and --message' '
test "$(git rev-parse subproj-br)" = "$split_hash" &&
# Check hash of split
new_hash=$(git rev-parse subproj-br^2) &&
(
cd ./"sub proj" &&
subdir_hash=$(git rev-parse HEAD) &&
check_equal ''"$new_hash"'' "$subdir_hash"
test ''"$new_hash"'' = "$subdir_hash"
)
)
'
@ -442,7 +430,7 @@ test_expect_success 'split "sub dir"/ with --branch for an existing branch' '
@@ -442,7 +430,7 @@ test_expect_success 'split "sub dir"/ with --branch for an existing branch' '
test "$(git rev-parse subproj-br)" = "$split_hash"
)
'
@ -740,7 +728,7 @@ test_expect_success 'make sure the --rejoin commits never make it into subproj'
@@ -740,7 +728,7 @@ test_expect_success 'make sure the --rejoin commits never make it into subproj'
(
cd "$test_count" &&
git subtree pull --prefix="sub dir" ./"sub proj" HEAD &&
@ -791,7 +779,7 @@ test_expect_success 'make sure no "git subtree" tagged commits make it into subp
@@ -791,7 +779,7 @@ test_expect_success 'make sure no "git subtree" tagged commits make it into subp
git subtree pull --prefix="sub dir" ./"sub proj" HEAD &&
# They are meaningless to subproj since one side of the merge refers to the mainline
test "$(git log --pretty=format:%P -1 subproj-br)" = "$(git rev-parse subproj-ref)"
)
'
@ -859,7 +847,7 @@ test_expect_success 'split a new subtree without --onto option' '
@@ -859,7 +847,7 @@ test_expect_success 'split a new subtree without --onto option' '
# if the parent of the first commit in the tree is not empty,
# then the new subtree has accidentally been attached to something