bless { git => $git, ref => "refs/heads/master" }, $class;
}
-# runs a command which returns a list of files, no file name sanitization
-# here needed since all of the path names stored in git trees are controlled
-# by us (and based on SHA-1 hexdigest)
+# runs a command which returns a list of files belonging to emails
+# This won't prevent invalid/corrupt messages from attempts at
+# being imported, though. This allows administrators to add things
+# like a top-level README file to avoid confusing folks who may
+# accidentally check out the ssoma repository as a working copy.
sub _flist {
my ($cmd) = @_;
my @rv = `$cmd`;
$? == 0 or die "$cmd failed: $?\n";
chomp @rv;
+ @rv = grep(m!\A[a-f0-9]{2}/[a-f0-9]{38}(?:/[a-f0-9]{40})?\z!, @rv);
\@rv
}