@@ -55,6 +55,9 @@ GIT_REMOTE_PULL_PARAMS="${GIT_REMOTE_PULL_PARAMS:---allow-unrelated-histories --
55
55
56
56
TEMPLATE_REMOTE_GIT_HASH=$( git ls-remote " ${SOURCE_REPO} " HEAD | awk ' {print $1}' )
57
57
SHORT_TEMPLATE_GIT_HASH=$( git rev-parse --short " ${TEMPLATE_REMOTE_GIT_HASH} " )
58
+ LOCAL_CURRENT_GIT_HASH=$( git rev-parse HEAD) # need to be run before a pull to get the current local git hash
59
+
60
+ info " current git hash: ${LOCAL_CURRENT_GIT_HASH} "
58
61
59
62
export TEMPLATE_GIT_HASH=${SHORT_TEMPLATE_GIT_HASH}
60
63
export PR_BRANCH=" ${PR_BRANCH_NAME_PREFIX} _${TEMPLATE_GIT_HASH} "
@@ -162,11 +165,13 @@ function check_staged_files_available_graceful_exit() {
162
165
163
166
# ######################################
164
167
# force source file deletion if they had been deleted
168
+ # Arguments:
169
+ # local_current_git_hash
165
170
# ######################################
166
171
function force_delete_files() {
167
172
info " force delete files"
168
173
warn " force file deletion is enabled. Deleting files which are deleted within the target repository"
169
- local_current_git_hash=$( git rev-parse HEAD )
174
+ local local_current_git_hash=$1
170
175
171
176
info " current git hash: ${local_current_git_hash} "
172
177
@@ -435,7 +440,7 @@ function arr_checkout_branch_and_pull() {
435
440
restore_templatesyncignore_file " ${TEMPLATE_SYNC_IGNORE_FILE_PATH} "
436
441
437
442
if [ " $IS_FORCE_DELETION " == " true" ]; then
438
- force_delete_files
443
+ force_delete_files " ${LOCAL_CURRENT_GIT_HASH} "
439
444
fi
440
445
441
446
echo " ::endgroup::"
0 commit comments