X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=diff-no-index.c;h=4cd9dacbe8e98d1420ebe1a217b0f927d24d125a;hb=bd01c6de67715586f7527115bb4f74e7929b3b66;hp=aae8e7accc1ff955bd76c62b379b37f343f61cc4;hpb=a0075d9e6ae211e8bde3eb40c8cdebb1772ee680;p=git.git diff --git a/diff-no-index.c b/diff-no-index.c index aae8e7acc..4cd9dacbe 100644 --- a/diff-no-index.c +++ b/diff-no-index.c @@ -150,16 +150,14 @@ static int queue_diff(struct diff_options *o, static int path_outside_repo(const char *path) { - /* - * We have already done setup_git_directory_gently() so we - * know we are inside a git work tree already. - */ const char *work_tree; size_t len; if (!is_absolute_path(path)) return 0; work_tree = get_git_work_tree(); + if (!work_tree) + return 1; len = strlen(work_tree); if (strncmp(path, work_tree, len) || (path[len] != '\0' && path[len] != '/'))