Skip to content
This repository was archived by the owner on Feb 13, 2021. It is now read-only.

Commit 4ad6a12

Browse files
committed
fix git issue
1 parent f7517f2 commit 4ad6a12

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

setup.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,14 +205,19 @@ manage_git(){
205205
print_verbose "Cloning '${git_repo}' to ${app_git_dir}"
206206
RUN_COMMAND_AS "git clone ${git_repo} --recursive"
207207
else
208+
cd "${app_git_dir}" || msg_exit "Failed to cd into '${app_git_dir}'"
208209
RUN_COMMAND_AS "git fetch origin --tags"
209210
fi
210211

211212
# will also run this first run :(
212-
print_verbose "checking out '${branch}' from '${git_repo}'"
213+
print_verbose "checking out '${branch}' from '${app_git_dir}'"
213214
cd "${app_git_dir}"
214215
RUN_COMMAND_AS "git checkout ${branch}"
215-
RUN_COMMAND_AS "git pull -q --rebase"
216+
217+
if git show-ref --verify "refs/heads/${branch}"; then
218+
print_verbose "git pulling from '${app_git_dir}'"
219+
RUN_COMMAND_AS "git pull -q --rebase"
220+
fi
216221

217222
if [ -z "${submodule}" ]; then
218223
print_verbose "git updating submodule for '${git_repo}'"

0 commit comments

Comments
 (0)