diff --git a/.gitignore b/.gitignore index ca58f735cb..5843eaf9cc 100644 --- a/.gitignore +++ b/.gitignore @@ -14,5 +14,6 @@ docs/_templates .gopath/ .dotcloud *.test -vendor/ bundles/ +.hg/ +.git/ diff --git a/hack/vendor.sh b/hack/vendor.sh index d327911047..5287449b4f 100755 --- a/hack/vendor.sh +++ b/hack/vendor.sh @@ -12,10 +12,12 @@ git_clone () { ( set -e cd $vendor_dir - if [[ ! -d src/$PKG ]]; then - cd $vendor_dir && git clone http://$PKG src/$PKG + if [[ -d src/$PKG ]]; then + echo "src/$PKG already exists. Removing." + rm -fr src/$PKG fi - cd src/$PKG && git checkout -f $REV + cd $vendor_dir && git clone http://$PKG src/$PKG + cd src/$PKG && git checkout -f $REV && rm -fr .git ) }