Skip to content

Commit

Permalink
Significantly faster tag deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Oct 17, 2013
1 parent 21cf853 commit a054752
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion framework/bin/horde-git-split.php
Expand Up @@ -18,11 +18,15 @@
chdir($tmp . '/tmp');
system('git remote rm origin');

$delete = array();
foreach (array_filter(explode("\n", shell_exec('git tag -l'))) as $val) {
if (strpos($val, $argv[1] . '-') === false) {
system('git tag -d ' . escapeshellarg($val));
$delete[] = escapeshellarg($val);
}
}
if (count($delete)) {
system('git tag -d ' . implode(' ', $delete));
}

system("git filter-branch --prune-empty --subdirectory-filter " . $argv[2] . " --tag-name-filter cat -- --all");
system('git update-ref -d refs/original/refs/heads/master');
Expand Down

0 comments on commit a054752

Please sign in to comment.