1 package com.proalpha.pds.gitutils.common;
4 import java.io.IOException;
5 import java.lang.reflect.InvocationTargetException;
6 import java.util.ArrayList;
9 import org.eclipse.swt.custom.BusyIndicator;
10 import org.eclipse.swt.widgets.Display;
11 import org.slf4j.Logger;
12 import org.slf4j.LoggerFactory;
23 private List<String> fileList;
24 private File workingDir;
27 this.workingDir = workingDir;
28 this.fileList = fileList;
39 Runnable r =
new Runnable() {
43 if (!fileList.isEmpty()) {
44 for (String fileToMerge : fileList) {
46 List<String> commands =
new ArrayList<String>();
49 commands.add(
"git mergetool " + fileToMerge);
51 ProcessBuilder pb =
new ProcessBuilder(commands);
52 pb.directory(workingDir);
54 logger.debug(
"Running commands " + commands +
" in " + workingDir);
57 }
catch (IOException e) {
59 logger.error(
"Process MergetoolOperation throws an IOException", e);
65 BusyIndicator.showWhile(Display.getCurrent(), r);