Skip to content

Commit

Permalink
Improve release merge script for deleted files
Browse files Browse the repository at this point in the history
  • Loading branch information
ernestognw committed Jun 14, 2023
1 parent 7cc2cbf commit a5cd5c0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/release/workflow/prepare-release-merge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ readarray -t DELETED_CHANGESETS < <(git diff origin/master --diff-filter=D --nam
# Ignore conflicts that can't be resolved.
git merge origin/master -m "Merge master to $GITHUB_REF_NAME" -X theirs || true

# When files were modified in the release branch but removed in master, git will not finish the merge
# and will leave the files in the index. We need to remove them manually.
git diff --name-only --diff-filter=U | xargs git rm

# Remove the originally deleted changesets to correctly sync with master
rm -f "${DELETED_CHANGESETS[@]}"

Expand Down

0 comments on commit a5cd5c0

Please sign in to comment.