diff options
Diffstat (limited to 'builtin/index-pack.c')
-rw-r--r-- | builtin/index-pack.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/index-pack.c b/builtin/index-pack.c index 0a27bab11b..d450a6ada2 100644 --- a/builtin/index-pack.c +++ b/builtin/index-pack.c @@ -1730,6 +1730,8 @@ int cmd_index_pack(int argc, const char **argv, const char *prefix) usage(index_pack_usage); if (fix_thin_pack && !from_stdin) die(_("--fix-thin cannot be used without --stdin")); + if (from_stdin && !startup_info->have_repository) + die(_("--stdin requires a git repository")); if (!index_name && pack_name) index_name = derive_filename(pack_name, ".idx", &index_name_buf); if (keep_msg && !keep_name && pack_name) |