From 736d29ac184e1cd0386a7cbb767fa0d53d91661d Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Fri, 17 Mar 2017 10:10:08 +0100 Subject: [PATCH] Fixed the retrieval of current branch --- docs/src/main/asciidoc/ghpages.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/src/main/asciidoc/ghpages.sh b/docs/src/main/asciidoc/ghpages.sh index 795b17f3..3c41f8c2 100755 --- a/docs/src/main/asciidoc/ghpages.sh +++ b/docs/src/main/asciidoc/ghpages.sh @@ -59,6 +59,7 @@ function retrieve_current_branch() { fi echo "Current branch is [${CURRENT_BRANCH}]" git checkout ${CURRENT_BRANCH} || echo "Failed to check the branch... continuing with the script" + PREVIOUS_BRANCH=${CURRENT_BRANCH} } # Switches to the provided value of the release version. We always prefix it with `v` @@ -248,7 +249,7 @@ function commit_changes_if_applicable() { function checkout_previous_branch() { # If -version was provided we need to come back to root project cd ${ROOT_FOLDER} - git checkout ${CURRENT_BRANCH} || echo "Failed to check the branch... continuing with the script" + git checkout ${PREVIOUS_BRANCH} || echo "Failed to check the branch... continuing with the script" if [ "$dirty" != "0" ]; then git stash pop; fi exit 0 }