diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/PullCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/PullCommand.java index f50567411..1c86bd663 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/PullCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/PullCommand.java @@ -138,7 +138,7 @@ public PullCommand setCredentialsProvider( */ public PullResult call() throws WrongRepositoryStateException, InvalidConfigurationException, DetachedHeadException, - InvalidRemoteException, CanceledException { + InvalidRemoteException, CanceledException, RefNotFoundException { checkCallable(); monitor.beginTask(JGitText.get().pullTaskName, 2); @@ -248,6 +248,9 @@ public PullResult call() throws WrongRepositoryStateException, } else { try { commitToMerge = repo.resolve(remoteBranchName); + if (commitToMerge == null) + throw new RefNotFoundException(MessageFormat.format( + JGitText.get().refNotResolved, remoteBranchName)); } catch (IOException e) { throw new JGitInternalException( JGitText.get().exceptionCaughtDuringExecutionOfPullCommand,