Skip to content

Commit 14958f6

Browse files
committed
Use a system property for git executable path
Defaulting to git on the system path.
1 parent 1cdcd37 commit 14958f6

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/main/java/net/imagej/ui/swing/updater/DiffFile.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,8 @@ public void run() {
275275
final PrintStream out = diffView.getPrintStream();
276276
out.println("\n");
277277
if (warning != null) diffView.warn(warning + "\n\n");
278-
ProcessUtils.exec(gitWorkingDirectory, out, out, "git", "log", "-M", "-p", since, commitRange, "--", relativePath);
278+
final String git = System.getProperty("imagej.updater.git.command", "git");
279+
ProcessUtils.exec(gitWorkingDirectory, out, out, git, "log", "-M", "-p", since, commitRange, "--", relativePath);
279280
}
280281
});
281282
}
@@ -328,8 +329,9 @@ private String findSourceDirectory(final File gitWorkingDirectory, final URL jar
328329
final String sourceFile = analyzer.getSourceFile();
329330
if (sourceFile == null) continue;
330331
final String suffix = path.substring(0, path.lastIndexOf('/') + 1) + sourceFile;
332+
final String git = System.getProperty("imagej.updater.git.command", "git");
331333
try {
332-
path = ProcessUtils.exec(gitWorkingDirectory, null, null, "git", "ls-files", "*/" + suffix);
334+
path = ProcessUtils.exec(gitWorkingDirectory, null, null, git, "ls-files", "*/" + suffix);
333335
if (path.length() <= suffix.length()) continue;
334336
if (path.endsWith("\n")) path = path.substring(0, path.length() - 1);
335337
} catch (RuntimeException e) {

src/main/java/net/imagej/ui/swing/updater/DiffView.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,8 @@ public static void main(String[] args) {
371371
@Override
372372
public void run() {
373373
try {
374-
ProcessUtils.exec(null, diff.getPrintStream(), diff.getPrintStream(), "git", "show");
374+
final String git = System.getProperty("imagej.updater.git.command", "git");
375+
ProcessUtils.exec(null, diff.getPrintStream(), diff.getPrintStream(), git, "show");
375376
} catch (RuntimeException e) {
376377
if (!(e.getCause() instanceof InterruptedException))
377378
e.printStackTrace();

0 commit comments

Comments
 (0)