X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=pathspec.c;h=8243e06eab48373d12729959fde8fe666eb312b2;hb=3bab5d56259722843359702bc27111475437ad2a;hp=166d255642db4c9b854dbd19018cbc854d1c4ca1;hpb=a4fd114ffca1e3c5fff48df382298c2ef9a32f67;p=thirdparty%2Fgit.git diff --git a/pathspec.c b/pathspec.c index 166d255642..8243e06eab 100644 --- a/pathspec.c +++ b/pathspec.c @@ -438,9 +438,13 @@ static void init_pathspec_item(struct pathspec_item *item, unsigned flags, } else { match = prefix_path_gently(prefix, prefixlen, &prefixlen, copyfrom); - if (!match) + if (!match) { + const char *hint_path = get_git_work_tree(); + if (!hint_path) + hint_path = get_git_dir(); die(_("%s: '%s' is outside repository at '%s'"), elt, - copyfrom, absolute_path(get_git_work_tree())); + copyfrom, absolute_path(hint_path)); + } } item->match = match;