diff options
author | Laurent Delaigue <laurent.delaigue@obeo.fr> | 2015-02-23 11:18:50 +0100 |
---|---|---|
committer | Christian Halstrick <christian.halstrick@sap.com> | 2015-03-02 15:33:30 +0100 |
commit | 26fd56f167e6377777e6d46c14779183e4bcb55a (patch) | |
tree | 1d852b5ff1a32930773aff6218c03b09e6e56245 /org.eclipse.jgit.java7 | |
parent | 12a55c34753669365d9e644e592d9d8c10e742f1 (diff) | |
download | jgit-26fd56f167e6377777e6d46c14779183e4bcb55a.tar.gz jgit-26fd56f167e6377777e6d46c14779183e4bcb55a.zip |
Refactored pre-commit hook to make it less invasive.
Hooks are now obtained via a convenient API like git commands, and
callers don't have to check for their existence.
The pre-commit hook has been updated accordingly.
Change-Id: I3383ffb10e2f3b588d7367b9139b606ec7f62758
Signed-off-by: Laurent Delaigue <laurent.delaigue@obeo.fr>
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.java | 4 | ||||
-rw-r--r-- | org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FS_Win32_Java7Cygwin.java | 4 |
2 files changed, 4 insertions, 4 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 300cf93bc8..118e166a29 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 @@ -352,10 +352,10 @@ public class FS_POSIX_Java7 extends FS_POSIX { * @since 3.7 */ @Override - public File findHook(Repository repository, Hook hook) { + public File findHook(Repository repository, String hookName) { final File gitdir = repository.getDirectory(); final Path hookPath = gitdir.toPath().resolve(Constants.HOOKS) - .resolve(hook.getName()); + .resolve(hookName); 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 b6e5d93885..4c371de9d0 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 @@ -145,10 +145,10 @@ public class FS_Win32_Java7Cygwin extends FS_Win32_Cygwin { * @since 3.7 */ @Override - public File findHook(Repository repository, Hook hook) { + public File findHook(Repository repository, String hookName) { final File gitdir = repository.getDirectory(); final Path hookPath = gitdir.toPath().resolve(Constants.HOOKS) - .resolve(hook.getName()); + .resolve(hookName); if (Files.isExecutable(hookPath)) return hookPath.toFile(); return null; |