| 322 | } |
| 323 | |
| 324 | bool GitPlugin::isValidRemoteRepositoryUrl(const QUrl& remoteLocation) |
| 325 | { |
| 326 | if (remoteLocation.isLocalFile()) { |
| 327 | QFileInfo fileInfo(remoteLocation.toLocalFile()); |
| 328 | if (fileInfo.isDir()) { |
| 329 | QDir dir(fileInfo.filePath()); |
| 330 | if (dir.exists(QStringLiteral(".git/HEAD"))) { |
| 331 | return true; |
| 332 | } |
| 333 | // TODO: check also for bare repo |
| 334 | } |
| 335 | } else { |
| 336 | const QString scheme = remoteLocation.scheme(); |
| 337 | if (scheme == QLatin1String("git") || scheme == QLatin1String("git+ssh")) { |
| 338 | return true; |
| 339 | } |
| 340 | // heuristic check, anything better we can do here without talking to server? |
| 341 | if ((scheme == QLatin1String("http") || |
| 342 | scheme == QLatin1String("https")) && |
| 343 | remoteLocation.path().endsWith(QLatin1String(".git"))) { |
| 344 | return true; |
| 345 | } |
| 346 | } |
| 347 | return false; |
| 348 | } |
| 349 | |
| 350 | bool GitPlugin::isVersionControlled(const QUrl &path) |
| 351 | { |
no test coverage detected