mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-05 00:42:48 +00:00
Check if remote.pushDefault is set when generating the remote link
This commit is contained in:
parent
927e87d5e8
commit
398944c6ff
@ -115,9 +115,20 @@ execute_process(
|
|||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
)
|
)
|
||||||
|
|
||||||
# Default to origin if there's no upstream set or if the command failed
|
# If there's no upstream set or the command failed, check remote.pushDefault
|
||||||
if (GIT_BRANCH_RESULT OR GIT_REMOTE_NAME STREQUAL "")
|
if (GIT_BRANCH_RESULT OR GIT_REMOTE_NAME STREQUAL "")
|
||||||
set(GIT_REMOTE_NAME "origin")
|
execute_process(
|
||||||
|
COMMAND git config --get remote.pushDefault
|
||||||
|
OUTPUT_VARIABLE GIT_REMOTE_NAME
|
||||||
|
RESULT_VARIABLE GIT_PUSH_DEFAULT_RESULT
|
||||||
|
ERROR_QUIET
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
)
|
||||||
|
|
||||||
|
# If remote.pushDefault is not set or fails, default to origin
|
||||||
|
if (GIT_PUSH_DEFAULT_RESULT OR GIT_REMOTE_NAME STREQUAL "")
|
||||||
|
set(GIT_REMOTE_NAME "origin")
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
# Extract remote name if the output contains a remote/branch format
|
# Extract remote name if the output contains a remote/branch format
|
||||||
string(FIND "${GIT_REMOTE_NAME}" "/" INDEX)
|
string(FIND "${GIT_REMOTE_NAME}" "/" INDEX)
|
||||||
|
Loading…
Reference in New Issue
Block a user