Skip to content

Commit e3153ab

Browse files
author
Ivan Vandot
authored
check if its only local branch (ethersphere#175)
1 parent 4caa596 commit e3153ab

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

.githooks/pre-push.bash

+8-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22

33
set -euo pipefail
44

5-
# Check if we actually have commits to push
6-
commits=$(git log @{u}..)
7-
if [ -z "$commits" ]; then
8-
exit 0
5+
# Get current branch name
6+
current=$(git rev-parse --abbrev-ref HEAD)
7+
if git branch -r | grep "^ ${1}/${current}$" &> /dev/null; then
8+
# Check if we actually have commits to push
9+
commits=$(git log @{u}..)
10+
if [ -z "$commits" ]; then
11+
exit 0
12+
fi
913
fi
1014

1115
make build lint vet test-race

0 commit comments

Comments
 (0)