forked from qt-creator/qt-creator
Git: Offer recent list of changes for reset --hard.
This makes it easier to remove changed applied for review by Gerrit. Change-Id: I2e3407ae4e74b650d08d53fed37e9aeb11071a4e Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
@@ -825,6 +825,30 @@ void GitClient::addFile(const QString &workingDirectory, const QString &fileName
|
||||
executeGit(workingDirectory, arguments, 0, true);
|
||||
}
|
||||
|
||||
bool GitClient::synchronousLog(const QString &workingDirectory, const QStringList &arguments,
|
||||
QString *output, QString *errorMessageIn)
|
||||
{
|
||||
QByteArray outputText;
|
||||
QByteArray errorText;
|
||||
QStringList allArguments;
|
||||
allArguments << QLatin1String("log") << QLatin1String(GitClient::noColorOption);
|
||||
allArguments.append(arguments);
|
||||
const bool rc = fullySynchronousGit(workingDirectory, allArguments, &outputText, &errorText);
|
||||
if (rc) {
|
||||
*output = commandOutputFromLocal8Bit(outputText);
|
||||
} else {
|
||||
const QString errorMessage = tr("Cannot obtain log of \"%1\": %2").
|
||||
arg(QDir::toNativeSeparators(workingDirectory),
|
||||
commandOutputFromLocal8Bit(errorText));
|
||||
if (errorMessageIn) {
|
||||
*errorMessageIn = errorMessage;
|
||||
} else {
|
||||
outputWindow()->appendError(errorMessage);
|
||||
}
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
// Warning: 'intendToAdd' works only from 1.6.1 onwards
|
||||
bool GitClient::synchronousAdd(const QString &workingDirectory,
|
||||
bool intendToAdd,
|
||||
|
||||
Reference in New Issue
Block a user