MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / performFastForward

Function performFastForward

plugins/vcs/Algorithm.h:211–238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209}
210
211inline 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
240inline void syncWithRemote(const std::shared_ptr<Repository>& repository)
241{

Callers 1

syncWithRemoteFunction · 0.85

Calls 10

getHeadMethod · 0.80
getUpstreamMethod · 0.80
findMergeBaseMethod · 0.80
getDiffMethod · 0.80
_Function · 0.50
getMapNameMethod · 0.45
containsFileMethod · 0.45
executeCommandMethod · 0.45

Tested by

no test coverage detected