@@ -956,6 +956,28 @@ it_can_check_a_repo_having_multiple_root_commits() {
956956 "
957957}
958958
959+ it_can_check_a_repo_having_multiple_root_commits_from_the_orphan_commit () {
960+ local repo=$( init_repo)
961+ local ref1=$( get_initial_ref $repo )
962+ local ref2=$( make_commit $repo )
963+
964+ # Same as above, but where the current version is the orphan commit.
965+ git -C $repo checkout --orphan temp $ref2
966+ git -C $repo commit -m " second root" --allow-empty
967+ git -C $repo checkout master
968+ git -C $repo merge temp --allow-unrelated-histories -m " merge commit"
969+ second_root=$( git -C $repo rev-parse HEAD^2)
970+ ref3=$( git -C $repo rev-parse HEAD)
971+
972+ check_uri_from $repo $second_root | jq -e "
973+ . == [
974+ {ref: $( echo $ref1 | jq -R .) },
975+ {ref: $( echo $ref2 | jq -R .) },
976+ {ref: $( echo $ref3 | jq -R .) }
977+ ]
978+ "
979+ }
980+
959981it_checks_with_version_depth () {
960982 local repo=$( init_repo)
961983 local ref1=$( make_commit_to_future $repo )
@@ -1040,5 +1062,6 @@ run it_can_check_with_tag_filter_given_branch_first_ref
10401062run it_can_check_with_tag_regex_given_branch_first_ref
10411063run it_checks_lastest_commit
10421064run it_can_check_a_repo_having_multiple_root_commits
1065+ run it_can_check_a_repo_having_multiple_root_commits_from_the_orphan_commit
10431066run it_checks_with_version_depth
10441067run it_checks_uri_with_tag_filter_and_version_depth
0 commit comments