forked from qt-creator/qt-creator
Improve git archive userbility
Archive should be saved at one level upper directory from repo dir. When user change archive name to e.g. project-v1.0, Qt Creator saves it to project-v1.tar.gz now. It should be project-v1.0.tar.gz Change-Id: Ibcd3c6bd8413bbb28fcdae13e5eb43016dc2b6a3 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -1225,7 +1225,7 @@ void GitClient::archive(const QString &workingDirectory, QString commit)
|
||||
QString archiveName = QFileDialog::getSaveFileName(
|
||||
ICore::dialogParent(),
|
||||
tr("Generate %1 archive").arg(repoName),
|
||||
repoDirectory + QString("/%1-%2").arg(repoName).arg(commit.left(8)),
|
||||
repoDirectory + QString("/../%1-%2").arg(repoName).arg(commit.left(8)),
|
||||
filters.keys().join(";;"),
|
||||
&selectedFilter);
|
||||
if (archiveName.isEmpty())
|
||||
@@ -1233,7 +1233,7 @@ void GitClient::archive(const QString &workingDirectory, QString commit)
|
||||
QString extension = filters.value(selectedFilter);
|
||||
QFileInfo archive(archiveName);
|
||||
if (archive.completeSuffix() != extension) {
|
||||
archive = QFileInfo(archive.absoluteDir().absoluteFilePath(archive.baseName() + extension));
|
||||
archive = QFileInfo(archive.filePath() + extension);
|
||||
}
|
||||
|
||||
if (archive.exists()) {
|
||||
|
Reference in New Issue
Block a user