|
@@ -26,9 +26,27 @@ allowed_slurp() {
|
26
|
26
|
|
27
|
27
|
allowed_push() {
|
28
|
28
|
#
|
29
|
|
- # Is push allowed in this repo?
|
|
29
|
+ # Is push allowed for the remote branch??
|
30
|
30
|
#
|
31
|
|
- grep -qxF PUSH "$ok_file" 2>/dev/null
|
|
31
|
+ # If this branch is tracking a remote branch, and the remote
|
|
32
|
+ # branch name is listed in .git-slurp-ok after PUSH, we are
|
|
33
|
+ # allowed to push
|
|
34
|
+ #
|
|
35
|
+ # The remote tracking branch is parsed; example output is here:
|
|
36
|
+ #
|
|
37
|
+ # $ git branch -vv
|
|
38
|
+ # main aaf02f0 [main/master: ahead 25] Some other commit
|
|
39
|
+ # * master add0a03 [jdsumsion/master] Some commit
|
|
40
|
+ #
|
|
41
|
+ local tbranch=$(
|
|
42
|
+ git branch -vv \
|
|
43
|
+ | grep '^\*' \
|
|
44
|
+ | cut -d \] -f1 \
|
|
45
|
+ | cut -d \[ -f2 \
|
|
46
|
+ | cut -d : -f1
|
|
47
|
+ )
|
|
48
|
+ test -n "$tbranch" || return 0
|
|
49
|
+ grep -qxF "PUSH $tbranch" "$ok_file" 2>/dev/null
|
32
|
50
|
}
|
33
|
51
|
|
34
|
52
|
git_relative() {
|