summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.java7
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2015-02-04 14:21:52 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2015-02-04 14:21:52 +0100
commit21f667edbaa1727e08ea9356fcbfbefdee481b2f (patch)
treec845201e9a152f9828f2e2b265bd873f5c80c0eb /org.eclipse.jgit.java7
parent23ad3a37638f295e22a67ca16aefeeb53467e289 (diff)
parentfc801dd79f7c6eb3765e4652136f219480478bf6 (diff)
downloadjgit-21f667edbaa1727e08ea9356fcbfbefdee481b2f.tar.gz
jgit-21f667edbaa1727e08ea9356fcbfbefdee481b2f.zip
Merge branch 'stable-3.7'
* stable-3.7: Add option --orphan for checkout Prepare post 3.7.0.201502031740-rc1 builds JGit v3.7.0.201502031740-rc1 Support for the pre-commit hook Fix FileUtils.testRelativize_mixedCase which failed on Mac OS X Add a hook test Introduce hook support into the FS implementations If a pack isn't found on disk remove it from pack list Conflicts: org.eclipse.jgit.java7.test/META-INF/MANIFEST.MF Change-Id: I936acd24d47b911fa30ab29856094e1b2c6ac3db Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.java7')
-rw-r--r--org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FS_POSIX_Java7.java16
-rw-r--r--org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FS_Win32_Java7Cygwin.java18
2 files changed, 34 insertions, 0 deletions
diff --git a/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FS_POSIX_Java7.java b/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FS_POSIX_Java7.java
index 4a73a9bcf5..300cf93bc8 100644
--- a/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FS_POSIX_Java7.java
+++ b/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FS_POSIX_Java7.java
@@ -53,6 +53,9 @@ import java.nio.file.Path;
import java.nio.file.attribute.PosixFilePermission;
import java.util.Set;
+import org.eclipse.jgit.lib.Constants;
+import org.eclipse.jgit.lib.Repository;
+
/**
* FS implementation for Java7 on unix like systems
*/
@@ -344,4 +347,17 @@ public class FS_POSIX_Java7 extends FS_POSIX {
public String normalize(String name) {
return FileUtil.normalize(name);
}
+
+ /**
+ * @since 3.7
+ */
+ @Override
+ public File findHook(Repository repository, Hook hook) {
+ final File gitdir = repository.getDirectory();
+ final Path hookPath = gitdir.toPath().resolve(Constants.HOOKS)
+ .resolve(hook.getName());
+ if (Files.isExecutable(hookPath))
+ return hookPath.toFile();
+ return null;
+ }
}
diff --git a/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FS_Win32_Java7Cygwin.java b/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FS_Win32_Java7Cygwin.java
index e40d7cf0b5..b6e5d93885 100644
--- a/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FS_Win32_Java7Cygwin.java
+++ b/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FS_Win32_Java7Cygwin.java
@@ -45,6 +45,11 @@ package org.eclipse.jgit.util;
import java.io.File;
import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+
+import org.eclipse.jgit.lib.Constants;
+import org.eclipse.jgit.lib.Repository;
/**
* FS for Java7 on Windows with Cygwin
@@ -135,4 +140,17 @@ public class FS_Win32_Java7Cygwin extends FS_Win32_Cygwin {
public Attributes getAttributes(File path) {
return FileUtil.getFileAttributesBasic(this, path);
}
+
+ /**
+ * @since 3.7
+ */
+ @Override
+ public File findHook(Repository repository, Hook hook) {
+ final File gitdir = repository.getDirectory();
+ final Path hookPath = gitdir.toPath().resolve(Constants.HOOKS)
+ .resolve(hook.getName());
+ if (Files.isExecutable(hookPath))
+ return hookPath.toFile();
+ return null;
+ }
}