diff --git a/CMakeLists.txt b/CMakeLists.txt index d05c5cda02..eb519aada9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,8 +94,8 @@ if(GIT_FOUND AND NOT DOLPHIN_WC_REVISION) OUTPUT_VARIABLE DOLPHIN_WC_DESCRIBE OUTPUT_STRIP_TRAILING_WHITESPACE) - # remove hash from description - STRING(REGEX REPLACE "-[^-]+((-dirty)?)$" "\\1" DOLPHIN_WC_DESCRIBE "${DOLPHIN_WC_DESCRIBE}") + # remove hash (and trailing "-0" if needed) from description + STRING(REGEX REPLACE "(-0)?-[^-]+((-dirty)?)$" "\\2" DOLPHIN_WC_DESCRIBE "${DOLPHIN_WC_DESCRIBE}") # defines DOLPHIN_WC_BRANCH EXECUTE_PROCESS(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD diff --git a/Source/Core/Common/make_scmrev.h.js b/Source/Core/Common/make_scmrev.h.js index 46ac598b84..f2978987dc 100644 --- a/Source/Core/Common/make_scmrev.h.js +++ b/Source/Core/Common/make_scmrev.h.js @@ -58,9 +58,8 @@ var describe = GetFirstStdOutLine(gitexe + cmd_describe); var branch = GetFirstStdOutLine(gitexe + cmd_branch); var isMaster = +("master" == branch); -// remove hash from description -describe = describe.replace(/-[^-]+(-dirty)?$/, '$1'); -describe = describe.replace("-0","") +// remove hash (and trailing "-0" if needed) from description +describe = describe.replace(/(-0)?-[^-]+(-dirty)?$/, '$2'); var out_contents = "#define SCM_REV_STR \"" + revision + "\"\n" +