Problem:
Sync fails when there had been any conflict resolution done in the source branch without using rebase
Solution:
Use cherry-pick as the default sync mode which will continue doing what the current code does. Introduce a sync mode that works by merging the contents of modified files. Call it file-merge. Find files modified in a commit using command git diff-tree --no-commit-id -r <commitSha>. The output of the command looks like below:
:100644 100755 772e30bf04d0b60b12ce56057dc68067f3902ff3 772e30bf04d0b60b12ce56057dc68067f3902ff3 M path/to/file.sh
The fields are old file mode, new file mode, old file hash, new file hash, the type of change(A/M/D - Added/Modified/Deleted) and path to file. When only file mode has changed, old file hash and new file hash will be the same
Problem:
Sync fails when there had been any conflict resolution done in the source branch without using rebase
Solution:
Use
cherry-pickas the default sync mode which will continue doing what the current code does. Introduce a sync mode that works by merging the contents of modified files. Call itfile-merge. Find files modified in a commit using commandgit diff-tree --no-commit-id -r <commitSha>. The output of the command looks like below:The fields are old file mode, new file mode, old file hash, new file hash, the type of change(A/M/D - Added/Modified/Deleted) and path to file. When only file mode has changed, old file hash and new file hash will be the same