Commit 11dbe9e8 authored by Gerrit Pape's avatar Gerrit Pape Committed by Junio C Hamano

git-archimport: initial import needs empty directory

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: 's avatarGerrit Pape <pape@smarden.org>
Signed-off-by: 's avatarJunio C Hamano <junkio@cox.net>
parent 756373da
......@@ -95,6 +95,15 @@ END
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment