public static string[] getRemoteNames(out bool success) { string[] cmds = new string[1]; cmds[0] = g("remote -v"); string[] feedback = CMD.CMDcmdsLines(cmds, false); success = true; for (int i = 0; i < feedback.Length; i++) { if (feedback[i].Contains("fatal:")) { success = false; } } if (success) { //worked now filter out to find those branch names ye ken string[] filtered = new string[feedback.Length - 1]; for (int i = 0; i < filtered.Length; i++) { int k = i + 1; filtered[i] = filterOriginName(feedback[k]); } return(StringFilter.FindDouble(filtered)); } else { string err = "ERROR GIT MIGHT NOT BE INITIALISED"; UI.giveWarning(err); return(new string[] { err }); } }
public static string getBranchFeedback(out bool success) { string[] cmds = new string[1]; cmds[0] = g("branch --show-current"); string[] feedback = CMD.CMDcmdsLines(cmds, false); success = true; for (int i = 0; i < feedback.Length; i++) { if (feedback[i].Contains("fatal:")) { success = false; } } if (success) { return(feedback[1]); } else { string err = "ERROR GIT MIGHT NOT BE INITIALISED"; UI.giveWarning(err); return(err); } }
public static bool ReadDatFile(IniParser parser)//read success bool returned { bool success = false; bool readremote = true; try { //read remoteb string remotearray = parser.getDatFromKey(mainsec, curremotepre, out readremote); string[] rarr = remotearray.Split(','); curRemote.Clear(); //check to make sure there are no spaces on any of those for (int i = 0; i < rarr.Length; i++) { if (rarr[i].Contains(" ")) { rarr[i] = StringFilter.RemoveSpace(rarr[i]); } curRemote.Add(rarr[i]); } //now no white spaces } catch { readremote = false; } if (readremote) { success = true; } else { return(false); } bool readversion = true; try { string versionfile = parser.getDatFromKey(mainsec, versionpre, out readversion); string curVersion = VersionController.WriteVersionNoOnly(); if (versionfile != curVersion) { UI.giveWarning("Different version used in saved config data"); } } catch { readversion = false; } if (readversion) { success = true; } else { return(false); } //got this far exit with a yay return(success); }