Browse Source

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 <markus.duft@ssi-schaefer.com>
stable-5.0
Markus Duft 7 years ago committed by David Pursehouse
parent
commit
aaf4b35557
  1. 6
      org.eclipse.jgit/src/org/eclipse/jgit/hooks/Hooks.java

6
org.eclipse.jgit/src/org/eclipse/jgit/hooks/Hooks.java

@ -115,7 +115,11 @@ public class Hooks {
outputStream); outputStream);
if (hook != null) { if (hook != null) {
if (hook.isNativeHookPresent()) { if (hook.isNativeHookPresent()) {
throw new IllegalStateException(MessageFormat PrintStream ps = outputStream;
if (ps == null) {
ps = System.out;
}
ps.println(MessageFormat
.format(JGitText.get().lfsHookConflict, repo)); .format(JGitText.get().lfsHookConflict, repo));
} }
return hook; return hook;

Loading…
Cancel
Save