- Use a better suited function name

Signed-off-by: Matt Darfeuille <matd...@gmail.com>
---
 build/release | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/build/release b/build/release
index 9ac63502..9ecfee54 100755
--- a/build/release
+++ b/build/release
@@ -153,13 +153,21 @@ create_tag() # $1 = path of repository, $2 = object
     fi
 }
 
-push_tag_func()
+push_command_func() # $1 = Path of repository, $2 = remote, $3 = branch
 {
-    echo "Pushing tag ${VERSION} from ${1}/.git..."
+    if [ -n "$3" ]; then
+        echo "Pushing branch $3 from ${1}/.git to ${2}..."
 
-    git --git-dir=${1}/.git push --quiet --follow-tags $2 HEAD
-    [ $? -ne 0 ] && fatal_error "Failed to push tag $VERSION from ${1}/.git."
+        git --git-dir=${1}/.git --work-tree=$1 push --quiet --follow-tags $2 $3
+        [ $? -ne 0 ] && fatal_error "Failed to push branch $3 from ${1}/.git 
to ${2}."
+    else
+        echo "Pushing checked out branch from ${1}/.git to ${2}..."
+
+        git --git-dir=${1}/.git --work-tree=$1 push --quiet --follow-tags $2
+        [ $? -ne 0 ] && fatal_error "Failed to push checked out branch from 
${1}/.git to ${2}."
+    fi
 }
+
 
################################################################################
 #                E X E C U T I O N   S T A R T S   H E R E
 
################################################################################
@@ -313,6 +321,6 @@ case $VERSION in
 esac
 
 for repo in $REPOSITORIES; do
-    push_tag_func $GIT $repo
-    push_tag_func $GITRELEASEDIR $repo
+    push_command_func $GIT $repo
+    push_command_func $GITRELEASEDIR $repo
 done
-- 
2.17.0


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Shorewall-devel mailing list
Shorewall-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/shorewall-devel

Reply via email to