diff options
author | Robert Loehning <[email protected]> | 2010-09-17 17:36:05 +0200 |
---|---|---|
committer | Robert Loehning <[email protected]> | 2010-09-20 12:48:08 +0200 |
commit | 1551faa678bcbb378ae224eb14af9a56f6c557de (patch) | |
tree | df7ddf1a6ce49be2aca5ebffa70ab5dac532b46f /src/plugins/git/gitclient.cpp | |
parent | b580a0c357c02dd8ae9a7885915269205dc4accd (diff) |
git: Added workaround for older versions which don't know format:%B
Diffstat (limited to 'src/plugins/git/gitclient.cpp')
-rw-r--r-- | src/plugins/git/gitclient.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 1b49ccdce95..8df29c6a4c6 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -1477,7 +1477,8 @@ bool GitClient::getCommitData(const QString &workingDirectory, if (amend) { // Amend: get last commit data as "SHA1@message". TODO: Figure out codec. QStringList args(QLatin1String("log")); - args << QLatin1String("--max-count=1") << QLatin1String("--pretty=format:%h@%B"); + const QString format = synchronousGitVersion(true) > 0x010701 ? "%h@%B" : "%h@%s%n%n%b"; + args << QLatin1String("--max-count=1") << QLatin1String("--pretty=format:") + format; const Utils::SynchronousProcessResponse sp = synchronousGit(repoDirectory, args); if (sp.result != Utils::SynchronousProcessResponse::Finished) { *errorMessage = tr("Unable to retrieve the last commit data of the repository %1.").arg(repoDirectory); |