]> source.dussan.org Git - jgit.git/commitdiff
Don't throw if a pre-push hook is ignored. 38/120438/3
authorMarkus Duft <markus.duft@ssi-schaefer.com>
Thu, 29 Mar 2018 13:28:07 +0000 (15:28 +0200)
committerDavid Pursehouse <david.pursehouse@gmail.com>
Wed, 11 Apr 2018 01:06:27 +0000 (21:06 -0400)
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 <markus.duft@ssi-schaefer.com>
org.eclipse.jgit/src/org/eclipse/jgit/hooks/Hooks.java

index 79395ed23f3c96fef1ce861725136836aeafbfe3..b801d6872b25b07279fd4722c04bad5b9d73ad59 100644 (file)
@@ -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;