Skip to content

Commit

Permalink
fix: fetch git remote add in one go + non-fatal errors
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Oct 2, 2024
1 parent e8d9925 commit 67d723a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/Git.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -346,12 +346,8 @@ function(git_add_remote)
endif()

execute_process(
COMMAND "${GIT_EXECUTABLE}" "remote" "add" "${_fun_REMOTE_NAME}" "${_fun_REMOTE_URL}"
WORKING_DIRECTORY "${_fun_REPOSITORY_PATH}" COMMAND_ERROR_IS_FATAL LAST
)
execute_process(
COMMAND "${GIT_EXECUTABLE}" "fetch" "${_fun_REMOTE_NAME}" WORKING_DIRECTORY "${_fun_REPOSITORY_PATH}"
COMMAND_ERROR_IS_FATAL LAST
COMMAND "${GIT_EXECUTABLE}" "remote" "add" "--fetch" "${_fun_REMOTE_NAME}" "${_fun_REMOTE_URL}"
WORKING_DIRECTORY "${_fun_REPOSITORY_PATH}"
)
endif()
endfunction()
Expand Down

0 comments on commit 67d723a

Please sign in to comment.