add an empty .gitignore to a newly created snapshot
[scpubgit/File-Tree-Snapshot.git] / lib / File / Tree / Snapshot.pm
index 3962e21..e2021d3 100644 (file)
@@ -57,6 +57,10 @@ sub create {
     my $path = $self->storage_path;
     $self->_mkpath($path);
     $self->_git_exec('init');
+    CORE::open my $fh, '>', "$path/.gitignore"
+      or die "Unable to write .gitignore in '$path': $!\n";
+    $self->_git_exec('add', '.gitignore');
+    $self->_git_exec('commit', '-m', '"Initial commit"');
     return 1;
 }