]> git.ipfire.org Git - thirdparty/git.git/blobdiff - setup.c
unpack-trees: also allow get_progress() to work on a different index
[thirdparty/git.git] / setup.c
diff --git a/setup.c b/setup.c
index 4ea7a0b081bfd20a87d413d887f6d6926dbde8ab..5ea9285a128c019018e48db1abea577f553f1785 100644 (file)
--- a/setup.c
+++ b/setup.c
@@ -120,9 +120,13 @@ char *prefix_path_gently(const char *prefix, int len,
 char *prefix_path(const char *prefix, int len, const char *path)
 {
        char *r = prefix_path_gently(prefix, len, NULL, path);
-       if (!r)
+       if (!r) {
+               const char *hint_path = get_git_work_tree();
+               if (!hint_path)
+                       hint_path = get_git_dir();
                die(_("'%s' is outside repository at '%s'"), path,
-                   absolute_path(get_git_work_tree()));
+                   absolute_path(hint_path));
+       }
        return r;
 }