Fix ssh git integration

This commit is contained in:
crschnick 2023-12-14 03:59:20 +00:00
parent 102b69f261
commit 3afbb2ed0a

View file

@ -62,6 +62,14 @@ public class CommandBuilder {
return this;
}
public CommandBuilder add(int index, String... s) {
for (String s1 : s) {
elements.add(index++, new Fixed(s1));
}
return this;
}
public CommandBuilder remove(String s) {
elements.removeIf(element -> element instanceof Fixed fixed && s.equals(fixed.string));
return this;
@ -82,6 +90,21 @@ public class CommandBuilder {
return this;
}
public CommandBuilder addQuoted(int index, String s) {
elements.add(index, sc -> {
if (s == null) {
return null;
}
if (sc == null) {
return "\"" + s + "\"";
}
return sc.getShellDialect().quoteArgument(s);
});
return this;
}
public CommandBuilder addSub(CommandBuilder sub) {
elements.add(sc -> {
if (sc == null) {