diff --git a/test/core/ExamplesUnitTests/configure_git_mockprogram_files/mockprogram_inout.single_repo_one_parent_version.txt b/test/core/ExamplesUnitTests/configure_git_mockprogram_files/mockprogram_inout.single_repo_one_parent_version.txt index f643a9ab1..a406d461e 100644 --- a/test/core/ExamplesUnitTests/configure_git_mockprogram_files/mockprogram_inout.single_repo_one_parent_version.txt +++ b/test/core/ExamplesUnitTests/configure_git_mockprogram_files/mockprogram_inout.single_repo_one_parent_version.txt @@ -1,12 +1,9 @@ -MOCK_PROGRAM_INPUT: log -1 --pretty=format:%H -MOCK_PROGRAM_RETURN: 0 -MOCK_PROGRAM_OUTPUT: a1234tgbhyujkliu126sl12123s -MOCK_PROGRAM_INPUT: log -1 --pretty=format:%h [%ad] <%ae> a1234tgbhyujkliu126sl12123s +MOCK_PROGRAM_INPUT: log -1 --pretty=format:%h [%ad] <%ae> HEAD MOCK_PROGRAM_RETURN: 0 MOCK_PROGRAM_OUTPUT: a1234tgb [Thu Sep 21 19:19:18 2023 -0400] -MOCK_PROGRAM_INPUT: log -1 --pretty=format:%s a1234tgbhyujkliu126sl12123s +MOCK_PROGRAM_INPUT: log -1 --pretty=format:%s HEAD MOCK_PROGRAM_RETURN: 0 MOCK_PROGRAM_OUTPUT: This is the HEAD commit summary line -MOCK_PROGRAM_INPUT: log -1 --pretty=format:%p a1234tgbhyujkliu126sl12123s +MOCK_PROGRAM_INPUT: log -1 --pretty=format:%p HEAD MOCK_PROGRAM_RETURN: 0 MOCK_PROGRAM_OUTPUT: b5678aop diff --git a/test/core/ExamplesUnitTests/configure_git_mockprogram_files/mockprogram_inout.single_repo_two_parents_version.txt b/test/core/ExamplesUnitTests/configure_git_mockprogram_files/mockprogram_inout.single_repo_two_parents_version.txt index be132f67e..fa4bb6a5e 100644 --- a/test/core/ExamplesUnitTests/configure_git_mockprogram_files/mockprogram_inout.single_repo_two_parents_version.txt +++ b/test/core/ExamplesUnitTests/configure_git_mockprogram_files/mockprogram_inout.single_repo_two_parents_version.txt @@ -1,13 +1,10 @@ -MOCK_PROGRAM_INPUT: log -1 --pretty=format:%H -MOCK_PROGRAM_RETURN: 0 -MOCK_PROGRAM_OUTPUT: a1234tgbhyujkliu126sl12123s -MOCK_PROGRAM_INPUT: log -1 --pretty=format:%h [%ad] <%ae> a1234tgbhyujkliu126sl12123s +MOCK_PROGRAM_INPUT: log -1 --pretty=format:%h [%ad] <%ae> HEAD MOCK_PROGRAM_RETURN: 0 MOCK_PROGRAM_OUTPUT: a1234tgb [Thu Sep 21 19:19:18 2023 -0400] -MOCK_PROGRAM_INPUT: log -1 --pretty=format:%s a1234tgbhyujkliu126sl12123s +MOCK_PROGRAM_INPUT: log -1 --pretty=format:%s HEAD MOCK_PROGRAM_RETURN: 0 MOCK_PROGRAM_OUTPUT: This is the HEAD commit summary line -MOCK_PROGRAM_INPUT: log -1 --pretty=format:%p a1234tgbhyujkliu126sl12123s +MOCK_PROGRAM_INPUT: log -1 --pretty=format:%p HEAD MOCK_PROGRAM_RETURN: 0 MOCK_PROGRAM_OUTPUT: b5678aop c9101hah MOCK_PROGRAM_INPUT: log -1 --pretty=format:%h [%ad] <%ae> b5678aop diff --git a/tribits/core/package_arch/TribitsGitRepoVersionInfo.cmake b/tribits/core/package_arch/TribitsGitRepoVersionInfo.cmake index 3fdbac7b2..6f187887e 100644 --- a/tribits/core/package_arch/TribitsGitRepoVersionInfo.cmake +++ b/tribits/core/package_arch/TribitsGitRepoVersionInfo.cmake @@ -184,19 +184,14 @@ function(tribits_generate_single_repo_version_string gitRepoDir # A) Get HEAD commit's info - tribits_git_repo_sha1(${gitRepoDir} - gitHeadSha1) - - tribits_generate_commit_info_string( - ${gitRepoDir} ${gitHeadSha1} - commitInfoString) + tribits_generate_commit_info_string(${gitRepoDir} HEAD commitInfoString) set(outStringBuilder ${commitInfoString}) # B) Get all of HEAD commit's parents into a list execute_process( - COMMAND ${GIT_EXECUTABLE} log -1 "--pretty=format:%p" ${gitHeadSha1} + COMMAND ${GIT_EXECUTABLE} log -1 "--pretty=format:%p" HEAD WORKING_DIRECTORY ${gitRepoDir} RESULT_VARIABLE gitCmndRtn OUTPUT_VARIABLE gitCmndOutput OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE