feat(bin): detect merge conflicts in merge-patch
When merge patching it will now detect if there is an unresolved conflict in your current branch and exit without doing anything. This is useful when merging multiple branches at once, if you hit a conflict half way though it would remove the "MERGE_PATCH" file and lose where you where in the patch Now the script will exit and not lose the position so you can `--continue` correctly after fixing the conflicts
This commit is contained in:
parent
060fa3d5f9
commit
f386272007
1 changed files with 11 additions and 0 deletions
|
|
@ -26,6 +26,17 @@ HELP
|
|||
exit 1;
|
||||
fi
|
||||
|
||||
#
|
||||
# Test for merge conflicts can abort if any are found. Theses need to be
|
||||
# resolved before you can continue
|
||||
#
|
||||
if [[ ! -z "$(git diff --name-only --diff-filter=U)" ]]; then
|
||||
echo "ERROR: Conflicts found, you need to resolve them before you continue your"
|
||||
echo "merge-patch. Use 'git am --show-current-patch' to see the failed patch. Then you"
|
||||
echo "can continue the merge-patch with 'git merge-patch --continue'"
|
||||
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$MERGE_BRANCH" == "--abort" ]]; then
|
||||
#
|
||||
|
|
|
|||
Loading…
Reference in a new issue