Skip to content

Commit

Permalink
Set variables regardless of verbosity (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
Elton Leong authored Aug 31, 2023
1 parent f3e14b2 commit 4ed951f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/scripts/compute_impacted_targets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ fetchRemoteGitHistory() {
fetchRemoteGitHistory "${MERGE_INSTANCE_BRANCH}"
fetchRemoteGitHistory "${PR_BRANCH}"

## Verbose logging for the Merge Instance and PR branch.
if [[ -n ${VERBOSE} ]]; then
git switch "${MERGE_INSTANCE_BRANCH}"
merge_instance_branch_head_sha=$(git rev-parse "${MERGE_INSTANCE_BRANCH}")
echo "Merge Instance Branch Head= ${merge_instance_branch_head_sha}"
git switch "${MERGE_INSTANCE_BRANCH}"
merge_instance_branch_head_sha=$(git rev-parse "${MERGE_INSTANCE_BRANCH}")
ifVerbose echo "Merge Instance Branch Head= ${merge_instance_branch_head_sha}"

git switch "${PR_BRANCH}"
pr_branch_head_sha=$(git rev-parse "${PR_BRANCH}")
echo "PR Branch Head= ${pr_branch_head_sha}"
git switch "${PR_BRANCH}"
pr_branch_head_sha=$(git rev-parse "${PR_BRANCH}")
ifVerbose echo "PR Branch Head= ${pr_branch_head_sha}"

## Verbose logging for the Merge Instance and PR branch.
if [[ -n ${VERBOSE} ]]; then
# Find the merge base of the two branches
merge_base_sha=$(git merge-base "${merge_instance_branch_head_sha}" "${pr_branch_head_sha}")
echo "Merge Base= ${merge_base_sha}"
Expand Down

0 comments on commit 4ed951f

Please sign in to comment.