# [PATCH] fast-import: exit with proper message if not a git dir

2 messages from 2008-02-28 to 2008-03-02. Participants: Jean-Luc Herren, Shawn O. Pearce.
Thread: https://gitlist.dev/t/12374

## Jean-Luc Herren, 2008-02-28 22:29

Subject: [PATCH] fast-import: exit with proper message if not a git dir
Message-ID: <47C735E2.2010500@gmx.ch>
URL: https://gitlist.dev/e/47C735E2.2010500%40gmx.ch

```
git fast-import expects to be run from an existing (possibly
empty) repository.  It was dying with a suboptimal message if that
wasn't the case.

Signed-off-by: Jean-Luc Herren <jlh@gmx.ch>
---
 fast-import.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fast-import.c b/fast-import.c
index 0d3449f..7f197d5 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -2377,6 +2377,7 @@ int main(int argc, const char **argv)
 {
 	unsigned int i, show_stats = 1;
 
+	setup_git_directory();
 	git_config(git_pack_config);
 	if (!pack_compression_seen && core_compression_seen)
 		pack_compression_level = core_compression_level;
-- 
1.5.4.2

```

## Shawn O. Pearce, 2008-03-02 23:16

Subject: Re: [PATCH] fast-import: exit with proper message if not a git dir
Message-ID: <20080302231649.GD8410@spearce.org>
URL: https://gitlist.dev/e/20080302231649.GD8410%40spearce.org
In-Reply-To: <47C735E2.2010500@gmx.ch>

```
Jean-Luc Herren <jlh@gmx.ch> wrote:
> git fast-import expects to be run from an existing (possibly
> empty) repository.  It was dying with a suboptimal message if that
> wasn't the case.
> 
> Signed-off-by: Jean-Luc Herren <jlh@gmx.ch>
> ---
> fast-import.c |    1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/fast-import.c b/fast-import.c
> index 0d3449f..7f197d5 100644
> --- a/fast-import.c
> +++ b/fast-import.c
> @@ -2377,6 +2377,7 @@ int main(int argc, const char **argv)
> {
> 	unsigned int i, show_stats = 1;
> 
> +	setup_git_directory();
> 	git_config(git_pack_config);
> 	if (!pack_compression_seen && core_compression_seen)
> 		pack_compression_level = core_compression_level;

Acked-by: Shawn O. Pearce <spearce@spearce.org>

-- 
Shawn.

```
