- my $actually_load_it = sub {
- if (/\.git/) {
- $File::Find::prune = 1;
- return;
- }
- return unless /\.pdf$/;
- my $xoj = 0;
- if (-e "${_}.xoj") {
- $xoj = 1;
+ if ($options{use_git}) {
+ my @files = grep /\.pdf\"?$/, split /\n/, qx(git ls-tree HEAD -r --full-name --name-only);
+ for my $file (@files) {
+ $file =~ s/^\"(.+)\"$/"qq($1)"/gee;
+ insert_or_replace_papers($dbh,$sth,basename($file),File::Spec->rel2abs($file), -e "${file}.xoj");