diff options
author | Thomas Wolf <thomas.wolf@paranor.ch> | 2018-12-02 05:34:18 -0500 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org <gerrit@eclipse.org> | 2018-12-02 05:34:18 -0500 |
commit | a08ffb04448ea225a8559403560537ac2ef50eb6 (patch) | |
tree | 66ac58ebb329b1dd5b064dd7ff38e42923a3a752 /org.eclipse.jgit.test | |
parent | 055c312bd153873b5e8ebbd9508f95eb005167be (diff) | |
parent | 9c755c9e7c6905013aa03df1089ea0b93d3241ce (diff) | |
download | jgit-a08ffb04448ea225a8559403560537ac2ef50eb6.tar.gz jgit-a08ffb04448ea225a8559403560537ac2ef50eb6.zip |
Merge "Set git environment variables for hooks" into stable-5.2
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/util/HookTest.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/HookTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/HookTest.java index e34c3cebd6..e5fcbf9d7c 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/HookTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/HookTest.java @@ -199,7 +199,8 @@ public class HookTest extends RepositoryTestCase { assumeSupportedPlatform(); writeHookFile(PreCommitHook.NAME, - "#!/bin/sh\necho \"test $1 $2\"\nread INPUT\necho $INPUT\necho 1>&2 \"stderr\""); + "#!/bin/sh\necho \"test $1 $2\"\nread INPUT\necho $INPUT\n" + + "echo $GIT_DIR\necho $GIT_WORK_TREE\necho 1>&2 \"stderr\""); ByteArrayOutputStream out = new ByteArrayOutputStream(); ByteArrayOutputStream err = new ByteArrayOutputStream(); ProcessResult res = FS.DETECTED.runHookIfPresent(db, @@ -208,7 +209,9 @@ public class HookTest extends RepositoryTestCase { "arg1", "arg2" }, new PrintStream(out), new PrintStream(err), "stdin"); - assertEquals("unexpected hook output", "test arg1 arg2\nstdin\n", + assertEquals("unexpected hook output", + "test arg1 arg2\nstdin\n" + db.getDirectory().getAbsolutePath() + + '\n' + db.getWorkTree().getAbsolutePath() + '\n', out.toString("UTF-8")); assertEquals("unexpected output on stderr stream", "stderr\n", err.toString("UTF-8")); |