aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Pearce <spearce@spearce.org>2011-02-16 10:15:31 -0500
committerCode Review <codereview-daemon@eclipse.org>2011-02-16 10:15:31 -0500
commitc13bf057540f11e2503e1205d46c800f9d00fd7b (patch)
tree2fd5dcac7e4f57daca7970cca0ab3416873200b7
parentbd531eb998e233b8be27ef9944cae2c1148db5b6 (diff)
parent68459b646e6c8243dc5650cbe08ce1bcdb8a621d (diff)
downloadjgit-c13bf057540f11e2503e1205d46c800f9d00fd7b.tar.gz
jgit-c13bf057540f11e2503e1205d46c800f9d00fd7b.zip
Merge "Fix NullPointer when pulling from a deleted local branch"
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/PullCommand.java5
1 files changed, 4 insertions, 1 deletions
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 f505674117..1c86bd6638 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 class PullCommand extends GitCommand<PullResult> {
*/
public PullResult call() throws WrongRepositoryStateException,
InvalidConfigurationException, DetachedHeadException,
- InvalidRemoteException, CanceledException {
+ InvalidRemoteException, CanceledException, RefNotFoundException {
checkCallable();
monitor.beginTask(JGitText.get().pullTaskName, 2);
@@ -248,6 +248,9 @@ public class PullCommand extends GitCommand<PullResult> {
} 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,