| Issue 365: | CommitMsgHookTest does not support windows | |
| 1 person starred this issue and may be notified of changes. | Back to list |
Affected Version: MASTER Environment: Windows The testclass com.google.gerrit.sshd.scproot.hooks.CommitMsgHookTest does not support windows as an execution env as it uses a shell script.
Dec 21, 2009
#1
sop@google.com
Dec 22, 2009
Yes, this would probably be the one option.
Another one would be to change
org.eclipse.jgit.junit.LocalDiskRepositoryTestCase.runHook(Repository, File,
String...) to
protected int runHook(final Repository db, final File hook,
final String... args) throws IOException, InterruptedException {
final String[] argv = null;
String os = System.getProperty("os.name");
if (os.startsWith("Windows")) {
argv = new String[2 + args.length];
argv[0] = "sh.exe";
argv[1] = hook.getAbsolutePath();
System.arraycopy(args, 0, argv, 2, args.length);
} else {
argv = new String[1 + args.length];
argv[0] = hook.getAbsolutePath();
System.arraycopy(args, 0, argv, 1, args.length);
}
final Map<String, String> env = cloneEnv();
env.put("GIT_DIR", db.getDirectory().getAbsolutePath());
putPersonIdent(env, "AUTHOR", author);
putPersonIdent(env, "COMMITTER", committer);
final File cwd = db.getWorkDir();
final Process p = Runtime.getRuntime().exec(argv, toEnvArray(env), cwd);
p.getOutputStream().close();
p.getErrorStream().close();
p.getInputStream().close();
return p.waitFor();
}
This would allow people running on windows to install cygwin with perl and run the
script.
What do you think?
Dec 22, 2009
Fixed by change I456fb8bd94558f6765eadd45274489e9c48c5f55. I actually am just skipping this test on Win32. Changing upstream JGit to start running hooks out of Cygwin is messier than it sounds.
Status:
Fixed
Labels: FixedIn-2.1.1
Oct 21, 2012
(No comment was entered for this change.)
Status:
Released
|
|
| ► Sign in to add a comment |