forked from qt-creator/qt-creator
Git: Use synchronousParentRevisions to retrieve parents
Replace explicit 'git log' call Change-Id: I7fd3821d9a321d84fa25bad4bd0a4525fee11993 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
d61a4f1ba5
commit
40d001694b
@@ -1311,7 +1311,6 @@ void GitClient::synchronousTagsForCommit(const QString &workingDirectory, const
|
|||||||
QByteArray &precedes, QByteArray &follows)
|
QByteArray &precedes, QByteArray &follows)
|
||||||
{
|
{
|
||||||
QStringList arguments;
|
QStringList arguments;
|
||||||
QByteArray parents;
|
|
||||||
arguments << QLatin1String("describe") << QLatin1String("--contains") << revision;
|
arguments << QLatin1String("describe") << QLatin1String("--contains") << revision;
|
||||||
fullySynchronousGit(workingDirectory, arguments, &precedes, 0, false);
|
fullySynchronousGit(workingDirectory, arguments, &precedes, 0, false);
|
||||||
int tilde = precedes.indexOf('~');
|
int tilde = precedes.indexOf('~');
|
||||||
@@ -1320,14 +1319,14 @@ void GitClient::synchronousTagsForCommit(const QString &workingDirectory, const
|
|||||||
else
|
else
|
||||||
precedes = precedes.trimmed();
|
precedes = precedes.trimmed();
|
||||||
|
|
||||||
arguments.clear();
|
QStringList parents;
|
||||||
arguments << QLatin1String("log") << QLatin1String("-n1") << QLatin1String("--pretty=format:%P") << revision;
|
QString errorMessage;
|
||||||
fullySynchronousGit(workingDirectory, arguments, &parents, 0, false);
|
synchronousParentRevisions(workingDirectory, QStringList(), revision, &parents, &errorMessage);
|
||||||
foreach (const QByteArray &p, parents.split(' ')) {
|
foreach (const QString &p, parents) {
|
||||||
QByteArray pf;
|
QByteArray pf;
|
||||||
arguments.clear();
|
arguments.clear();
|
||||||
arguments << QLatin1String("describe") << QLatin1String("--tags")
|
arguments << QLatin1String("describe") << QLatin1String("--tags")
|
||||||
<< QLatin1String("--abbrev=0") << QLatin1String(p);
|
<< QLatin1String("--abbrev=0") << p;
|
||||||
fullySynchronousGit(workingDirectory, arguments, &pf, 0, false);
|
fullySynchronousGit(workingDirectory, arguments, &pf, 0, false);
|
||||||
pf.truncate(pf.lastIndexOf('\n'));
|
pf.truncate(pf.lastIndexOf('\n'));
|
||||||
if (!pf.isEmpty()) {
|
if (!pf.isEmpty()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user