@@ -57,7 +57,6 @@ function(is_backport_patch_present patch_path repo_dir patch_in_branch)
5757 WORKING_DIRECTORY ${repo_dir}
5858 RESULT_VARIABLE patch_not_in_branches
5959 OUTPUT_QUIET
60- ERROR_QUIET
6160 )
6261 if (patch_not_in_branches)
6362 set (patch_in_branch False PARENT_SCOPE) # The patch is not present in local branch
@@ -74,7 +73,6 @@ function(is_valid_revision repo_dir revision return_val)
7473 COMMAND ${GIT_EXECUTABLE} log -1 ${revision}
7574 WORKING_DIRECTORY ${repo_dir}
7675 RESULT_VARIABLE output_var
77- ERROR_QUIET
7876 OUTPUT_QUIET
7977 )
8078 if (${output_var} EQUAL 0)
@@ -106,7 +104,6 @@ function(apply_patches repo_dir patches_dirs base_revision target_branch ret)
106104 COMMAND ${GIT_EXECUTABLE} rev-parse --verify --no -revs -q ${target_branch}
107105 WORKING_DIRECTORY ${repo_dir}
108106 RESULT_VARIABLE patches_needed
109- ERROR_QUIET
110107 OUTPUT_QUIET
111108 )
112109 if (patches_needed EQUAL 128) # not a git repo
@@ -122,7 +119,6 @@ function(apply_patches repo_dir patches_dirs base_revision target_branch ret)
122119 WORKING_DIRECTORY ${repo_dir}
123120 OUTPUT_VARIABLE repo_head
124121 OUTPUT_STRIP_TRAILING_WHITESPACE
125- ERROR_QUIET
126122 )
127123 message (STATUS "[OPENCL-CLANG] ref ${base_revision} not exists in repository, using current HEAD:${repo_head} " )
128124 set (base_revision ${repo_head} )
@@ -142,10 +138,9 @@ function(apply_patches repo_dir patches_dirs base_revision target_branch ret)
142138 message (STATUS "[OPENCL-CLANG] Patch ${patch} is already in local branch - ignore patching" )
143139 else ()
144140 execute_process ( # Apply the patch
145- COMMAND ${GIT_EXECUTABLE} am --3way --ignore -whitespace ${patch}
141+ COMMAND ${GIT_EXECUTABLE} am --3way --ignore -whitespace -C0 ${patch}
146142 WORKING_DIRECTORY ${repo_dir}
147143 OUTPUT_VARIABLE patching_log
148- ERROR_QUIET
149144 RESULT_VARIABLE ret_apply_patch
150145 )
151146 message (STATUS "[OPENCL-CLANG] Not present - ${patching_log} " )
@@ -159,7 +154,6 @@ function(apply_patches repo_dir patches_dirs base_revision target_branch ret)
159154 COMMAND ${GIT_EXECUTABLE} checkout ${target_branch}
160155 WORKING_DIRECTORY ${repo_dir}
161156 RESULT_VARIABLE ret_check_out
162- ERROR_QUIET
163157 OUTPUT_QUIET
164158 )
165159 endif ()
0 commit comments