aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Blewitt2013-04-27 06:34:57 (EDT)
committerAlex Blewitt2013-04-27 06:42:58 (EDT)
commit37f0e324b5e82f55371ef8adc195d35f7a196c58 (patch)
tree3e699d097e27c92f98f4905ed944934782dc6a77
parentbe047307fcd179934e0cd3a0cf4ffe9c758d5370 (diff)
downloadjgit-37f0e324b5e82f55371ef8adc195d35f7a196c58.zip
jgit-37f0e324b5e82f55371ef8adc195d35f7a196c58.tar.gz
jgit-37f0e324b5e82f55371ef8adc195d35f7a196c58.tar.bz2
Allow deletions to occur when there is no HEADrefs/changes/68/12268/1
If the HEAD is not present in a repository, then there is a NullPointerException thrown in the delete code. Since this only exists to verify if the deletion is not the HEAD reference, then skip this check if the HEAD cannot be found. Bug: 406722 Change-Id: I882497202d986096513a4d791cd07fa935a3f9e4 Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/RefUpdate.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefUpdate.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefUpdate.java
index 9ef1722..8d59cb4 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefUpdate.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefUpdate.java
@@ -531,7 +531,7 @@ public abstract class RefUpdate {
final String myName = getRef().getLeaf().getName();
if (myName.startsWith(Constants.R_HEADS)) {
Ref head = getRefDatabase().getRef(Constants.HEAD);
- while (head.isSymbolic()) {
+ while (head != null && head.isSymbolic()) {
head = head.getTarget();
if (myName.equals(head.getName()))
return result = Result.REJECTED_CURRENT_BRANCH;