threads / patch / 12374

patchfast-import: exit with proper message if not a git dir

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

## tl;dr

2 messages between Feb 28, 2008 and Mar 2, 2008. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Jean-Luc Herren· Feb 28, 2008, 22:29 UTC · lore

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(-)
Show changes to fast-import.c +1 −0
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· Mar 2, 2008, 23:16 UTC · re: Jean-Luc Herren · lore

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

Jean-Luc Herren <jlh@gmx.ch> wrote:
Show 21 quoted lines
> 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.

← back to recent threads