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>
This commit is contained in:
parent
2ae9a85045
commit
6c64148f66
|
@ -232,7 +232,8 @@ private static File findGitDir() {
|
|||
if (gitDir.isDirectory())
|
||||
return gitDir;
|
||||
current = current.getParentFile();
|
||||
if (ceilingDirectories.contains(current.getPath()))
|
||||
if (current != null
|
||||
&& ceilingDirectories.contains(current.getPath()))
|
||||
break;
|
||||
}
|
||||
return null;
|
||||
|
|
Loading…
Reference in New Issue