diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/actions/fetch.bash | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/actions/fetch.bash b/lib/actions/fetch.bash index ec65aaa..4c95b0a 100644 --- a/lib/actions/fetch.bash +++ b/lib/actions/fetch.bash @@ -72,21 +72,20 @@ download_module_git() { notice "Cloning $url@$ref to $destination" mkdir -p -- "$destination" - pushd -- "$destination" > /dev/null + chgdir "$destination" git init > /dev/null git remote add origin "$url" 2> /dev/null git fetch origin -a 2> /dev/null # Try to use the ref (branch or tag) - if ! git reset --hard "origin/$ref" 2>&1 > /dev/null + if ! git reset --hard "origin/$ref" > /dev/null 2>&1 then # Or the commit hash git reset --hard "$(git log -1 --format=format:"%H" "$ref")" fi rm -fr -- .git - popd -- "$destination" > /dev/null } download_module_http() { |