summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2010-03-11 10:47:12 -0800
committerShawn O. Pearce <spearce@spearce.org>2010-03-11 15:15:03 -0800
commit6c64148f666dad0046086b65eb4912dafafe7a20 (patch)
tree800201b2ad45ef64c2a9e647ea954f05c8b60e52 /org.eclipse.jgit.pgm
parent2ae9a85045915a38af2c300aa1874304fd8ea17b (diff)
downloadjgit-6c64148f666dad0046086b65eb4912dafafe7a20.tar.gz
jgit-6c64148f666dad0046086b65eb4912dafafe7a20.zip
pgm: Report not in git repository rather than NPE
If we can't find a Git repository after searching all the way up to the filesystem root, JGit threw an NPE because we tried to get the path of null. Change-Id: I4e42364aeba53993c0ea528a9aeba3f08c7b3321 Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Reviewed-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Diffstat (limited to 'org.eclipse.jgit.pgm')
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java
index 10ebef4637..f1191a4599 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java
@@ -232,7 +232,8 @@ public class Main {
if (gitDir.isDirectory())
return gitDir;
current = current.getParentFile();
- if (ceilingDirectories.contains(current.getPath()))
+ if (current != null
+ && ceilingDirectories.contains(current.getPath()))
break;
}
return null;