diff --git a/libexec/rbenv-version-origin b/libexec/rbenv-version-origin index a9d21c4c..3f1d4f03 100755 --- a/libexec/rbenv-version-origin +++ b/libexec/rbenv-version-origin @@ -3,6 +3,8 @@ set -e [ -n "$RBENV_DEBUG" ] && set -x +unset RBENV_VERSION_ORIGIN + OLDIFS="$IFS" IFS=$'\n' scripts=(`rbenv-hooks version-origin`) IFS="$OLDIFS" diff --git a/test/version-origin.bats b/test/version-origin.bats index fed0aaa5..e0576648 100644 --- a/test/version-origin.bats +++ b/test/version-origin.bats @@ -52,3 +52,8 @@ setup() { assert_success "plugin" } + +@test "doesn't inherit RBENV_VERSION_ORIGIN from environment" { + RBENV_VERSION_ORIGIN=ignored run rbenv-version-origin + assert_success "${RBENV_ROOT}/version" +}