Properly reverse-sort git's tag list again; the rsort on the original output

of the command looked bogus: since each tag ref is prefixed by an iso date and
since commit 94da55d1 by hash, the whole string was of course sorted by this
date and later hash, but not the tag name. This should now make more sense.
This commit is contained in:
Thomas Keller 2011-06-02 00:22:00 +02:00
parent cab1c09ffc
commit 80313c88c8

View File

@ -218,15 +218,15 @@ class IDF_Scm_Git extends IDF_Scm
$cmd, $return, $cmd, $return,
implode("\n", $out))); implode("\n", $out)));
} }
rsort($out);
$res = array(); $res = array();
foreach ($out as $b) { foreach ($out as $b) {
$elts = explode(' ', $b, 2); $elts = explode(' ', $b, 2);
$tag = substr(trim($elts[1]), 10); // Remove refs/tags/ prefix $tag = substr(trim($elts[1]), 10); // Remove refs/tags/ prefix
$res[$tag] = ''; $res[$tag] = '';
} }
krsort($res);
$this->cache['tags'] = $res; $this->cache['tags'] = $res;
return $res; return $res;
} }