Remove full tag when requested
This commit is contained in:
parent
13f85455f8
commit
85008adfdf
|
@ -122,6 +122,14 @@ sub tag_project
|
|||
$year = LDAP::get_year;
|
||||
}
|
||||
|
||||
# Determine full tag
|
||||
my $long_tag;
|
||||
if (!$_[3])
|
||||
{
|
||||
my $proj_id = $_[2] // "";
|
||||
$long_tag = "project,$proj_id,$year";
|
||||
}
|
||||
|
||||
if ($creation)
|
||||
{
|
||||
my $newref = $ARGV[2];
|
||||
|
@ -189,21 +197,31 @@ sub tag_project
|
|||
|
||||
log DONE, "Projet créé/mis à jour avec succès.";
|
||||
|
||||
# Add full tag
|
||||
if (!$_[3])
|
||||
if ($long_tag)
|
||||
{
|
||||
my $proj_id = $_[2] // "";
|
||||
my $year = $_[3] // LDAP::get_year();
|
||||
my $tag = "project,$proj_id,$year";
|
||||
qx(git tag -f $tag);
|
||||
qx(git tag -f $long_tag);
|
||||
if (! $?) {
|
||||
log INFO, "Tag long créé : $tag.";
|
||||
log INFO, "Tag long créé : $long_tag.";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
# Is the long tag existing
|
||||
qx(git tag | egrep "^$long_tag$");
|
||||
if ($?) {
|
||||
log ERROR, "Tag long correspondant introuvable : $long_tag.";
|
||||
}
|
||||
|
||||
log USAGE, "Suppression du projet !";
|
||||
|
||||
if ($long_tag)
|
||||
{
|
||||
qx(git tag -d $long_tag);
|
||||
if (! $?) {
|
||||
log INFO, "Tag long supprimé : $long_tag.";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in New Issue
Block a user