Skip to content

Commit

Permalink
only try removing the deleted file
Browse files Browse the repository at this point in the history
  • Loading branch information
jazzsequence committed Aug 2, 2024
1 parent 7258398 commit 5b9a424
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions devops/scripts/deploy-public-upstream.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,11 @@ for commit in "${commits[@]}"; do
echo "Conflict detected in $commit. Checking for deleted files."
conflicted_files=$(git diff --name-only --diff-filter=U)
for file in $conflicted_files; do
if git diff "$commit"^.."$commit" -- "$file" | grep -q 'delete mode'; then
if ! git ls-tree -r "$commit" --name-only | grep -q "^$file$"; then
echo "File $file was deleted in the cherry-picked commit. Resolving by keeping the deletion."
git rm "$file"
else
echo "Resolving conflict for $file with 'theirs'."
git checkout --theirs -- "$file"
git add "$file"
echo "Conflict required manual resolution for $file."
fi
done

Expand Down

0 comments on commit 5b9a424

Please sign in to comment.