Permalink
Browse files

allow all enviromental variables to be passed to the git process

  • Loading branch information...
1 parent 29558e4 commit 71684f958f9327479818a19969965a5c3e8c75a9 CSH committed Apr 6, 2012
@@ -73,7 +73,7 @@ public void process(File currentWorkingDirectory, String[] args) {
}
private void outputSyntax() {
- System.out.println("Teb repository manager (version 1.0)");
+ System.out.println("Teb repository manager (version 1.1)");
System.out.println("Syntax:");
System.out.println("\tteb COMMAND");
System.out.println("\t init TEB_REPO_LOCATION [MANIFEST_FILENAME] \n\t This command initialises a teb repo in the current working directory using the arguments passed on the commandline");
@@ -11,6 +11,8 @@
import java.util.logging.Level;
import java.util.logging.Logger;
import uk.co.ignesco.teb.lists.StringList;
+import java.util.Map;
+
/**
*
@@ -91,6 +93,7 @@ private StringList runWithStringList(String []cmd, String [] env, String working
Process p = Runtime.getRuntime().exec(cmd,env,new File(workingDir));
InputStream is = p.getInputStream();
+ //is = p.getErrorStream();
InputStreamReader isr = new InputStreamReader(is);
StringList retVal = toStringList(isr);
@@ -236,19 +239,18 @@ public StringList gitRebase(String repoLocator, String origin, String branch) th
}
private String[] getEnvArray() {
- String[] retVal = null;
-
- String authSockString = System.getenv("SSH_AUTH_SOCK");
-
- if(authSockString==null) {
- retVal = new String[0];
- } else if(authSockString.length()==0) {
- retVal = new String[0];
- } else {
- retVal = new String[1];
- retVal[0] = "SSH_AUTH_SOCK=" + authSockString;
- }
-
- return retVal;
+
+ Map<String, String> env = System.getenv();
+
+ int size = env.size();
+ String[] retVal = new String[size];
+ int index = 0;
+
+ for(String var : env.keySet()) {
+ String s = var+"="+env.get(var);
+ retVal[index++] = s;
+ }
+
+ return retVal;
}
}

0 comments on commit 71684f9

Please sign in to comment.