[PATCH util-modular 1/4] release.sh: move remote name/branch parsing further up

Emil Velikov emil.l.velikov at gmail.com
Thu Jan 19 19:30:07 UTC 2017


From: Emil Velikov <emil.velikov at collabora.com>

Would be required with next commit as we'll be checking out (indirectly
via git worktree) another branch.

Regardless of that it makes sense that we parse the config before making
any local changes.

Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
 release.sh | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/release.sh b/release.sh
index e70a183..e3ed636 100755
--- a/release.sh
+++ b/release.sh
@@ -339,6 +339,19 @@ process_module() {
 	return 1
     fi
 
+    # Determine what is the current branch and the remote name
+    current_branch=`git branch | $GREP "\*" | sed -e "s/\* //"`
+    remote_name=`git config --get branch.$current_branch.remote`
+    remote_branch=`git config --get branch.$current_branch.merge | cut -d'/' -f3,4`
+    echo "Info: working off the \"$current_branch\" branch tracking the remote \"$remote_name/$remote_branch\"."
+
+    # Obtain the section
+    get_section
+    if [ $? -ne 0 ]; then
+	cd $top_src
+	return 1
+    fi
+
     # Check for uncommitted/queued changes.
     check_local_changes
     if [ $? -ne 0 ]; then
@@ -382,19 +395,6 @@ process_module() {
         return 1
     fi
 
-    # Determine what is the current branch and the remote name
-    current_branch=`git branch | $GREP "\*" | sed -e "s/\* //"`
-    remote_name=`git config --get branch.$current_branch.remote`
-    remote_branch=`git config --get branch.$current_branch.merge | cut -d'/' -f3,4`
-    echo "Info: working off the \"$current_branch\" branch tracking the remote \"$remote_name/$remote_branch\"."
-
-    # Obtain the section
-    get_section
-    if [ $? -ne 0 ]; then
-	cd $top_src
-	return 1
-    fi
-
     # Run 'make dist/distcheck' to ensure the tarball matches the git module content
     # Important to run make dist/distcheck before looking in Makefile, may need to reconfigure
     echo "Info: running \"make $MAKE_DIST_CMD\" to create tarballs:"
-- 
2.11.0



More information about the xorg-devel mailing list