Skip to content

Commit

Permalink
feat(git-branch-linearity): add support to main or master target branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume MOCQUET committed Jun 16, 2021
1 parent 872f868 commit c4fb368
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion git-branch-linearity.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/sh
out=$(git log origin/master..HEAD --merges --oneline)

if [ "$(git branch --list main)" ]; then TARGET_BRANCH="main"; else TARGET_BRANCH="master"; fi

echo "Target branch: $TARGET_BRANCH"
out=$(git log origin/${TARGET_BRANCH}..HEAD --merges --oneline)

exit_status=$?
if [ -n "$out" ]
Expand Down

0 comments on commit c4fb368

Please sign in to comment.