ADD: check if repository already has an issue manager

This commit is contained in:
Dominik Meyer 2019-03-24 00:01:22 +01:00
parent b61b7dedf9
commit b6e4b2d6ba
No known key found for this signature in database
GPG Key ID: B4C312B600606B64

View File

@ -225,6 +225,11 @@ sub init
my $ref = $self->repository->getReference('refs/heads/issues'); my $ref = $self->repository->getReference('refs/heads/issues');
my $root = $ref->getTree(); my $root = $ref->getTree();
#check if version and tag file already exist
my $checkVersion=$root->find(".version");
my $checkTag=$root->find(".tag");
die("repository already has an initialized issue manager") unless !(defined($checkVersion) && defined($checkTag));
my $version = $root->newBlob(); my $version = $root->newBlob();
$version->path(".version"); $version->path(".version");
$version->_content("0.1"); $version->_content("0.1");