Skip to content
Snippets Groups Projects
Commit 511ff06e authored by nimrod's avatar nimrod
Browse files

- Fix tests.

- Fix issue when diff is empty.
- Forgot --stdout in patch generation.
- Fix issue when it's the same branch.
parent dee94cb4
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,10 @@ set -eu
dest="${1:-master}"
current="$(git symbolic-ref --short HEAD)"
[ "$current" != "$dest" ] || exit
[ "$current" != "$dest" ] || exit 0
git format-patch "$(git merge-base HEAD "$dest")..$dest" --stdout | git apply --check -
patch="$(git format-patch "$(git merge-base HEAD "$dest")..$dest" --stdout)"
[ "$patch" != "" ] || exit 0
echo "$patch" | git apply --check -
......@@ -9,16 +9,16 @@ export repo="$BATS_TMPDIR/testrepo"
git init "$repo"
cd "$repo"
echo 1 > file
git -C "$repo" add "$repo/file"
git -C "$repo" commit -m "Initial commit."
git -C "$repo" checkout -b master2
git -C "$repo" checkout -b no-conflict
git -C "$repo" checkout -b conflict
echo 2 > "$repo/file"
git -C "$repo" commit file -m "Conflict with master."
git -C "$repo" checkout master
echo 3 > "$repo/file"
git -C "$repo" commit file -m "Conflict with the conflict branch."
git add file
git commit -m "Initial commit."
git checkout -b master2
git checkout -b no-conflict
git checkout -b conflict
echo 2 > file
git commit file -m "Conflict with master."
git checkout master
echo 3 > file
git commit file -m "Conflict with the conflict branch."
fi
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment