Skip to content

Commit

Permalink
YCMEPHelper: Remove check for git global name and email being set eve…
Browse files Browse the repository at this point in the history
…n if NON_INTERACTIVE_BUILD is OFF (#472)
  • Loading branch information
traversaro authored Jan 17, 2025
1 parent 46af9ad commit aa42f45
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/YCMEPHelper.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -327,17 +327,17 @@ function(_YCM_SETUP_GIT)
RESULT_VARIABLE _error_code
OUTPUT_VARIABLE _output_name
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT NON_INTERACTIVE_BUILD AND _error_code)
message(FATAL_ERROR "Failed to get git name. Please set it with \"git config --global user.name Firstname Lastname\" or from your favorite git gui.")
if(_error_code)
set(_output_name "")
endif()

execute_process(COMMAND ${GIT_EXECUTABLE} config --get user.email
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE _error_code
OUTPUT_VARIABLE _output_email
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT NON_INTERACTIVE_BUILD AND _error_code)
message(FATAL_ERROR "Failed to get git email. Please set it with \"git config --global user.email [email protected]\" or from your favorite git gui.")
if(_error_code)
set(_output_email "")
endif()

set(YCM_GIT_COMMIT_NAME "${_output_name}" CACHE STRING "Name to use for git commits")
Expand Down

0 comments on commit aa42f45

Please sign in to comment.