mirror of
https://github.com/moparisthebest/xeps
synced 2024-11-21 16:55:07 -05:00
ci: correctly detect outdated branches
This commit is contained in:
parent
b028cca04d
commit
7941813d79
@ -1,7 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
filenames="$(git diff-tree -r --no-commit-id --name-status "$(git merge-base "$1" HEAD)" HEAD | ( grep -P '^[AM]\t(xep-[0-9]{4}|inbox/[^/]+)\.xml$' || true) | cut -f2)"
|
if ! merge_base="$(git merge-base "$1" HEAD)"; then
|
||||||
|
echo 'Failed to find merge base to detect changed files' >&2
|
||||||
|
echo 'This indicates that your branch is too old and needs to be rebased' >&2
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
filenames="$(git diff-tree -r --no-commit-id --name-status "$merge_base" HEAD | ( grep -P '^[AM]\t(xep-[0-9]{4}|inbox/[^/]+)\.xml$' || true) | cut -f2)"
|
||||||
if [ -z "$filenames" ]; then
|
if [ -z "$filenames" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user