local list_refs_from=path remote="${1-}"
local format refs pfx
- if [ -n "$remote" ]; then
+ if [ -z "$remote" ]; then
+ if [ -z "$dir" ]; then
+ return
+ fi
+ else
if __git_is_configured_remote "$remote"; then
# configured remote takes precedence over a
# local directory with the same name
fi
fi
- if [ "$list_refs_from" = path ] && [ -d "$dir" ]; then
+ if [ "$list_refs_from" = path ]; then
case "$cur" in
refs|refs/*)
format="refname"
test_must_be_empty "$actual"
'
-test_expect_failure '__git_refs - not in a git repository' '
+test_expect_success '__git_refs - not in a git repository' '
(
GIT_CEILING_DIRECTORIES="$ROOT" &&
export GIT_CEILING_DIRECTORIES &&