Skip to content

Commit

Permalink
tools/update-submodules: add -b option to change the remote branch
Browse files Browse the repository at this point in the history
  • Loading branch information
rlane committed Aug 13, 2014
1 parent 02ca965 commit ded1531
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tools/update-submodules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,18 @@
# will only commit the submodule update with the generated commit message.

pull=1
branch=master

while getopts ":nh" opt; do
while getopts ":nb:h" opt; do
case $opt in
n)
pull=0
;;
b)
branch=$OPTARG
;;
h)
echo "usage: $0 [-n] [PATH...]"
echo "usage: $0 [-nb] [PATH...]"
exit 0
;;
\?)
Expand All @@ -58,7 +62,7 @@ for S in $paths; do
if [ $pull -eq 1 ]; then
echo "Updating $S"
git -C $S checkout --quiet master
git -C $S pull --quiet origin master
git -C $S pull --quiet origin $branch
fi
if ! git diff --quiet $S; then
(echo "update $(basename $S)"; echo; git submodule summary $S) | git commit -F- $S
Expand Down

0 comments on commit ded1531

Please sign in to comment.