Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
git-archimport: initial import needs empty directory
author
Gerrit Pape
<pape@smarden.org>
Sat, 3 Feb 2007 22:38:59 +0000
(22:38 +0000)
committer
Junio C Hamano
<junkio@cox.net>
Mon, 5 Feb 2007 01:05:16 +0000
(17:05 -0800)
git-archimport should better refuse to start an initial import if the
current directory is not empty.
(http://bugs.debian.org/400508)
Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-archimport.perl
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
756373d
)
diff --git
a/git-archimport.perl
b/git-archimport.perl
index 2e15781246c4a5997eb595885801fe7c6e741495..66aaeae1021eb3c791815f927e95a87e7afa557c 100755
(executable)
--- a/
git-archimport.perl
+++ b/
git-archimport.perl
@@
-95,6
+95,15
@@
END
my $tmp = tempdir('git-archimport-XXXXXX', TMPDIR => 1, CLEANUP => 1);
$opt_v && print "+ Using $tmp as temporary directory\n";
my $tmp = tempdir('git-archimport-XXXXXX', TMPDIR => 1, CLEANUP => 1);
$opt_v && print "+ Using $tmp as temporary directory\n";
+unless (-d $git_dir) { # initial import needs empty directory
+ opendir DIR, '.' or die "Unable to open current directory: $!\n";
+ while (my $entry = readdir DIR) {
+ $entry =~ /^\.\.?$/ or
+ die "Initial import needs an empty current working directory.\n"
+ }
+ closedir DIR
+}
+
my %reachable = (); # Arch repositories we can access
my %unreachable = (); # Arch repositories we can't access :<
my @psets = (); # the collection
my %reachable = (); # Arch repositories we can access
my %unreachable = (); # Arch repositories we can't access :<
my @psets = (); # the collection