Merge "Change FS not to throw NPE when facing InMemory databases"
This commit is contained in:
commit
91b1ab90e2
|
@ -866,7 +866,10 @@ protected ProcessResult internalRunHookIfPresent(Repository repository,
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
public File findHook(Repository repository, final String hookName) {
|
public File findHook(Repository repository, final String hookName) {
|
||||||
final File hookFile = new File(new File(repository.getDirectory(),
|
File gitDir = repository.getDirectory();
|
||||||
|
if (gitDir == null)
|
||||||
|
return null;
|
||||||
|
final File hookFile = new File(new File(gitDir,
|
||||||
Constants.HOOKS), hookName);
|
Constants.HOOKS), hookName);
|
||||||
return hookFile.isFile() ? hookFile : null;
|
return hookFile.isFile() ? hookFile : null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -335,6 +335,9 @@ public String normalize(String name) {
|
||||||
@Override
|
@Override
|
||||||
public File findHook(Repository repository, String hookName) {
|
public File findHook(Repository repository, String hookName) {
|
||||||
final File gitdir = repository.getDirectory();
|
final File gitdir = repository.getDirectory();
|
||||||
|
if (gitdir == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
final Path hookPath = gitdir.toPath().resolve(Constants.HOOKS)
|
final Path hookPath = gitdir.toPath().resolve(Constants.HOOKS)
|
||||||
.resolve(hookName);
|
.resolve(hookName);
|
||||||
if (Files.isExecutable(hookPath))
|
if (Files.isExecutable(hookPath))
|
||||||
|
|
Loading…
Reference in New Issue