85
85
/// command. Don't call this method twice on an instance.
87
87
/// <returns>the result of the pull</returns>
88
/// <exception cref="NGit.Api.Errors.WrongRepositoryStateException"></exception>
89
/// <exception cref="NGit.Api.Errors.InvalidConfigurationException"></exception>
90
/// <exception cref="NGit.Api.Errors.DetachedHeadException"></exception>
91
/// <exception cref="NGit.Api.Errors.InvalidRemoteException"></exception>
92
/// <exception cref="NGit.Api.Errors.CanceledException"></exception>
93
/// <exception cref="NGit.Api.Errors.RefNotFoundException"></exception>
94
/// <exception cref="NGit.Api.Errors.NoHeadException"></exception>
88
/// <exception cref="NGit.Api.Errors.WrongRepositoryStateException">NGit.Api.Errors.WrongRepositoryStateException
90
/// <exception cref="NGit.Api.Errors.InvalidConfigurationException">NGit.Api.Errors.InvalidConfigurationException
92
/// <exception cref="NGit.Api.Errors.DetachedHeadException">NGit.Api.Errors.DetachedHeadException
94
/// <exception cref="NGit.Api.Errors.InvalidRemoteException">NGit.Api.Errors.InvalidRemoteException
96
/// <exception cref="NGit.Api.Errors.CanceledException">NGit.Api.Errors.CanceledException
98
/// <exception cref="NGit.Api.Errors.RefNotFoundException">NGit.Api.Errors.RefNotFoundException
100
/// <exception cref="NGit.Api.Errors.NoHeadException">NGit.Api.Errors.NoHeadException
102
/// <exception cref="NGit.Api.Errors.TransportException">NGit.Api.Errors.TransportException
104
/// <exception cref="NGit.Api.Errors.GitAPIException">NGit.Api.Errors.GitAPIException
95
106
public override PullResult Call()
240
string upstreamName = "branch \'" + Repository.ShortenRefName(remoteBranchName) +
241
"\' of " + remoteUri;
229
242
PullResult result;
232
245
RebaseCommand rebase = new RebaseCommand(repo);
235
RebaseResult rebaseRes = rebase.SetUpstream(commitToMerge).SetProgressMonitor(monitor
236
).SetOperation(RebaseCommand.Operation.BEGIN).Call();
237
result = new PullResult(fetchRes, remote, rebaseRes);
239
catch (NoHeadException e)
241
throw new JGitInternalException(e.Message, e);
243
catch (RefNotFoundException e)
245
throw new JGitInternalException(e.Message, e);
247
catch (JGitInternalException e)
249
throw new JGitInternalException(e.Message, e);
251
catch (GitAPIException e)
253
throw new JGitInternalException(e.Message, e);
246
RebaseResult rebaseRes = rebase.SetUpstream(commitToMerge).SetUpstreamName(upstreamName
247
).SetProgressMonitor(monitor).SetOperation(RebaseCommand.Operation.BEGIN).Call();
248
result = new PullResult(fetchRes, remote, rebaseRes);
258
252
MergeCommand merge = new MergeCommand(repo);
259
string name = "branch \'" + Repository.ShortenRefName(remoteBranchName) + "\' of "
261
merge.Include(name, commitToMerge);
262
MergeCommandResult mergeRes;
265
mergeRes = merge.Call();
267
result = new PullResult(fetchRes, remote, mergeRes);
269
catch (NoHeadException e)
271
throw new JGitInternalException(e.Message, e);
273
catch (ConcurrentRefUpdateException e)
275
throw new JGitInternalException(e.Message, e);
277
catch (NGit.Api.Errors.CheckoutConflictException e)
279
throw new JGitInternalException(e.Message, e);
281
catch (InvalidMergeHeadsException e)
283
throw new JGitInternalException(e.Message, e);
285
catch (WrongRepositoryStateException e)
287
throw new JGitInternalException(e.Message, e);
289
catch (NoMessageException e)
291
throw new JGitInternalException(e.Message, e);
253
merge.Include(upstreamName, commitToMerge);
254
MergeCommandResult mergeRes = merge.Call();
256
result = new PullResult(fetchRes, remote, mergeRes);
294
258
monitor.EndTask();