Git: fix archive file name

When a filename such as a.tar.gz is given and the filter tar.gz is
selected, Qt Creator generated a.tar.gz.tar.gz because string from the
filter doesn't start with a "." and QFileInfo::completeSuffix() starts with
a ".".

Change-Id: I58fedf79a88b25cd595e17adb8d5660e066658f0
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Tasuku Suzuki
2021-06-11 22:03:16 +09:00
parent c218d8a543
commit 9e5ba5d679

View File

@@ -1248,7 +1248,7 @@ void GitClient::archive(const QString &workingDirectory, QString commit)
return;
QString extension = filters.value(selectedFilter);
QFileInfo archive(archiveName);
if (archive.completeSuffix() != extension) {
if (extension != "." + archive.completeSuffix()) {
archive = QFileInfo(archive.filePath() + extension);
}