Skip to content

Commit 8d7a53f

Browse files
committed
check-branch.sh: Make the shell script work on GNU
The "tail -r" invocation is BSD-specific. We need to use a line reversing statement that is POSIX compliant.
1 parent c43f98a commit 8d7a53f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

check-branch.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
# recording whether the build passes or fails for each.
55

66
commits=$@
7-
test "$commits" || commits=$(git rev-list HEAD ^master | tail -r)
7+
test "$commits" || commits=$(git rev-list HEAD ^master | sed '1!G;h;$!d')
8+
# NB: The sed line above reverses the order of the commits.
9+
# See: http://stackoverflow.com/a/744093
810

911
branch=$(git rev-parse --abbrev-ref HEAD)
1012

0 commit comments

Comments
 (0)