From aaf4b355574f1d34c767b3de8c1686f08e849cb3 Mon Sep 17 00:00:00 2001 From: Markus Duft Date: Thu, 29 Mar 2018 15:28:07 +0200 Subject: [PATCH] Don't throw if a pre-push hook is ignored. This breaks any scenario where native git (with LFS) clones a repository (and thus installs the hook) and later on JGit is used to push changes. Change-Id: I2a17753377265a0b612ba3451b9df63a577a1c38 Signed-off-by: Markus Duft --- org.eclipse.jgit/src/org/eclipse/jgit/hooks/Hooks.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/hooks/Hooks.java b/org.eclipse.jgit/src/org/eclipse/jgit/hooks/Hooks.java index 79395ed23f..b801d6872b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/hooks/Hooks.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/hooks/Hooks.java @@ -115,7 +115,11 @@ public class Hooks { outputStream); if (hook != null) { if (hook.isNativeHookPresent()) { - throw new IllegalStateException(MessageFormat + PrintStream ps = outputStream; + if (ps == null) { + ps = System.out; + } + ps.println(MessageFormat .format(JGitText.get().lfsHookConflict, repo)); } return hook; -- 2.39.5