Changeset 2539 for trunk


Ignore:
Timestamp:
Nov 12, 2009, 10:46:57 PM (15 years ago)
Author:
broder
Message:

Disallow pushing to submodule branches that are tracking branches for
pockets.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/scripts/git-hooks/sub/update

    r2503 r2539  
    1919fi
    2020
     21# --- Disallow pushing to the branches for pockets
     22
     23pocket_to_git() {
     24    local pocket git
     25    pocket="$1"
     26    git="$(invirt-getconf "git.pockets.$pocket.git" 2>/dev/null)"
     27    if [ $? != 0 ]; then
     28        git="$pocket"
     29    fi
     30    echo "$git"
     31}
     32
     33for pocket in $(invirt-getconf -l git.pockets); do
     34    if [ "$ref" = "refs/heads/$(pocket_to_git "$pocket")" ]; then
     35        echo "*** Pushing to a pocket branch in this repository is not allowed" >&2
     36        exit 1
     37    fi
     38done
     39
    2140# --- Disallow pushing tags
    2241
Note: See TracChangeset for help on using the changeset viewer.