diff --git a/antigen.zsh b/antigen.zsh index 189f0cd..f08bf45 100644 --- a/antigen.zsh +++ b/antigen.zsh @@ -210,11 +210,18 @@ antigen-revert () { local old_rev="$(--plugin-git rev-parse HEAD)" # Pull changes if update requested. --plugin-git pull + # If pull failed then try to pull directly from the clone directory + # In older version (1.8) of git the previous command seems not to work + if [ $? -ne 0 ]; then + pushd > /dev/null + git pull + popd > /dev/null + fi # Update submodules. - pushd + pushd > /dev/null cd "$clone_dir" git submodule update --recursive - popd + popd > /dev/null # Get the new revision. local new_rev="$(--plugin-git rev-parse HEAD)" fi