Skip to content

Commit 221fc35

Browse files
committed
Fix return
1 parent 373460f commit 221fc35

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cmake/modules/CMakeFunctions.cmake

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,11 @@ function(apply_patches repo_dir patches_dir base_revision target_branch)
104104
ERROR_QUIET
105105
OUTPUT_QUIET
106106
)
107-
if(patches_needed) # The target branch doesn't exist
107+
if(patches_needed EQUAL "128")
108+
message(STATUS "[OPENCL-CLANG] ${repo_dir} is not a git repository")
109+
return()
110+
endif()
111+
if(patches_needed EQUAL "1") # The target branch doesn't exist
108112
list(SORT patches)
109113
is_valid_revision(${repo_dir} ${base_revision} exists_base_rev)
110114

@@ -142,7 +146,7 @@ function(apply_patches repo_dir patches_dir base_revision target_branch)
142146
message(STATUS "[OPENCL-CLANG] Not present - ${patching_log}")
143147
endif()
144148
endforeach(patch)
145-
else() # The target branch already exists
149+
elsef(patches_needed EQUAL "0") # The target branch already exists
146150
execute_process( # Check it out
147151
COMMAND ${GIT_EXECUTABLE} checkout ${target_branch}
148152
WORKING_DIRECTORY ${repo_dir}

0 commit comments

Comments
 (0)