filter-branch: always export GIT_DIR if it is set
[gitweb.git] / builtin-ls-files.c
index f7c066b24b7a6a728fd2f0bf4a92a31fb4a695dd..48a313516db12dbb74d1f0293d3a55edc0cb3f2c 100644 (file)
@@ -470,7 +470,7 @@ int cmd_ls_files(int argc, const char **argv, const char *prefix)
        }
 
        if (require_work_tree &&
-                       (is_bare_repository() || is_inside_git_dir()))
+                       (!is_inside_work_tree() || is_inside_git_dir()))
                die("This operation must be run in a work tree");
 
        pathspec = get_pathspec(prefix, argv + i);