| 209 | } |
| 210 | |
| 211 | inline void performFastForward(const std::shared_ptr<Repository>& repository) |
| 212 | { |
| 213 | auto head = repository->getHead(); |
| 214 | auto upstream = head->getUpstream(); |
| 215 | |
| 216 | // Find the merge base for this ref and its upstream |
| 217 | auto mergeBase = repository->findMergeBase(*head, *upstream); |
| 218 | |
| 219 | auto remoteDiffAgainstBase = repository->getDiff(*upstream, *mergeBase); |
| 220 | |
| 221 | auto mapPath = repository->getRepositoryRelativePath(GlobalMapModule().getMapName()); |
| 222 | bool remoteDiffContainsMap = remoteDiffAgainstBase->containsFile(mapPath); |
| 223 | |
| 224 | repository->fastForwardToTrackedRemote(); |
| 225 | |
| 226 | if (!remoteDiffContainsMap) |
| 227 | { |
| 228 | return; |
| 229 | } |
| 230 | |
| 231 | // The map has been modified on disk, so it might be a good choice to reload the map |
| 232 | if (wxutil::Messagebox::Show(_("Map has been updated"), |
| 233 | _("The map file has been updated on disk, reload the map file now?"), |
| 234 | ::ui::IDialog::MessageType::MESSAGE_ASK) == ::ui::IDialog::RESULT_YES) |
| 235 | { |
| 236 | GlobalCommandSystem().executeCommand("OpenMap", GlobalMapModule().getMapName()); |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | inline void syncWithRemote(const std::shared_ptr<Repository>& repository) |
| 241 | { |
no test coverage detected