fix usage of branches with auto-ansible
This commit is contained in:
parent
7a30d8f493
commit
a2b2dcd449
1 changed files with 5 additions and 1 deletions
|
@ -111,6 +111,7 @@ PASSWORD_STORE_DIR="${AUTOANSIBLE_PASS_DIR}"
|
|||
|
||||
git_reset_pull () {
|
||||
repo_dir="$1"
|
||||
branch="$2"
|
||||
|
||||
printf "%s\n" "* cd ${repo_dir}" >> ${LOGFILE2}
|
||||
cd "${repo_dir}"
|
||||
|
@ -177,6 +178,9 @@ git_reset_pull () {
|
|||
# keep branch list up-to-date
|
||||
printf "%s\n" "* $BIN_GIT fetch -q --all --prune --recurse-submodules" >> ${LOGFILE2}
|
||||
$BIN_GIT fetch -q --all --prune --recurse-submodules >> ${LOGFILE2}
|
||||
# Switch to desired branch
|
||||
printf "%s\n" "* $BIN_GIT checkout -q ${branch}" >> ${LOGFILE2}
|
||||
$BIN_GIT checkout -q "${branch}" >> ${LOGFILE2}
|
||||
|
||||
return $ret
|
||||
}
|
||||
|
@ -188,7 +192,7 @@ git_clone_pull () {
|
|||
|
||||
# operations on the repo
|
||||
if [ -d "${repo_dir}" ]; then
|
||||
git_reset_pull "${repo_dir}" >> ${LOGFILE2}
|
||||
git_reset_pull "${repo_dir}" "${branch}" >> ${LOGFILE2}
|
||||
ret=$?
|
||||
elif [ -e "${repo_dir}" ]; then
|
||||
printf "%s\n" "ERROR: Destination ${repo_dir} already exists and is not a dir. Exiting." 1>&2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue