mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-05-24 22:48:23 -05:00
dbhub: Only provide commit id when pushing when the database is a clone
When pushing a database to the remote server only provide the commit id when the database file is saved in the directory of cloned databases. This makes sure we do not provide any random commit id when a database with the same name as a cloned database is pushed. See issue #1164.
This commit is contained in:
@@ -583,10 +583,13 @@ void RemoteDatabase::push(const QString& filename, const QString& url, const QSt
|
||||
addPart(multipart, "licence", licence);
|
||||
addPart(multipart, "public", isPublic ? "true" : "false");
|
||||
addPart(multipart, "branch", branch);
|
||||
addPart(multipart, "commit", QString::fromStdString(localLastCommitId(clientCert, url, branch.toStdString())));
|
||||
addPart(multipart, "force", forcePush ? "true" : "false");
|
||||
addPart(multipart, "lastmodified", last_modified.toString("yyyy-MM-dd'T'HH:mm:ss'Z'"));
|
||||
|
||||
// Only add commit id if the pushed file is actually a cloned file
|
||||
if(filename.startsWith(Settings::getValue("remote", "clonedirectory").toString()))
|
||||
addPart(multipart, "commit", QString::fromStdString(localLastCommitId(clientCert, url, branch.toStdString())));
|
||||
|
||||
// Set SSL configuration when trying to access a file via the HTTPS protocol
|
||||
bool https = QUrl(url).scheme().compare("https", Qt::CaseInsensitive) == 0;
|
||||
if(https)
|
||||
|
||||
Reference in New Issue
Block a user