Skip to content

Commit c4fb368

Browse files
author
Guillaume MOCQUET
committed
feat(git-branch-linearity): add support to main or master target branch
1 parent 872f868 commit c4fb368

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

git-branch-linearity.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/sh
2-
out=$(git log origin/master..HEAD --merges --oneline)
2+
3+
if [ "$(git branch --list main)" ]; then TARGET_BRANCH="main"; else TARGET_BRANCH="master"; fi
4+
5+
echo "Target branch: $TARGET_BRANCH"
6+
out=$(git log origin/${TARGET_BRANCH}..HEAD --merges --oneline)
37

48
exit_status=$?
59
if [ -n "$out" ]

0 commit comments

Comments
 (0)