X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-ls-files.c;h=61577ea13ffdf0143dcb8a13c37ae49c1f8f2018;hb=9a4cbdca34f6aa9424fce8a55fe9dd6f7c25d97b;hp=f7c066b24b7a6a728fd2f0bf4a92a31fb4a695dd;hpb=c63a3ad2c1d6f86cd7989055a133e06055239317;p=git.git diff --git a/builtin-ls-files.c b/builtin-ls-files.c index f7c066b24..61577ea13 100644 --- a/builtin-ls-files.c +++ b/builtin-ls-files.c @@ -117,7 +117,7 @@ static void show_other_files(struct dir_struct *dir) if (0 <= pos) continue; /* exact match */ pos = -pos - 1; - if (pos < active_nr) { + if (pos < active_nr) { ce = active_cache[pos]; if (ce_namelen(ce) == len && !memcmp(ce->name, ent->name, len)) @@ -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);