mirror of https://gitlab.com/basile.b/dexed.git
fix #348 - piping git - stderr is also for log, stdout is just for the payload
This commit is contained in:
parent
391fa0e271
commit
6e8d8889a1
|
@ -4020,7 +4020,6 @@ var
|
||||||
p: TProcess;
|
p: TProcess;
|
||||||
r: TStringList;
|
r: TStringList;
|
||||||
i: integer;
|
i: integer;
|
||||||
b: string;
|
|
||||||
begin
|
begin
|
||||||
p := TProcess.Create(nil);
|
p := TProcess.Create(nil);
|
||||||
r := TStringList.Create;
|
r := TStringList.Create;
|
||||||
|
@ -4028,24 +4027,25 @@ begin
|
||||||
p.Executable := exeFullName('git' + exeExt);
|
p.Executable := exeFullName('git' + exeExt);
|
||||||
if p.Executable.fileExists then
|
if p.Executable.fileExists then
|
||||||
begin
|
begin
|
||||||
p.Options := [poUsePipes, poNoConsole];
|
p.Options := [poUsePipes, poNoConsole, poStderrToOutPut];
|
||||||
p.ShowWindow:= swoHIDE;
|
p.ShowWindow:= swoHIDE;
|
||||||
p.Parameters.Add('pull');
|
p.Parameters.Add('pull');
|
||||||
//p.Parameters.Add('&&');
|
|
||||||
//p.Parameters.Add('git');
|
|
||||||
//p.Parameters.Add('submodule');
|
|
||||||
//p.Parameters.Add('--update');
|
|
||||||
//p.Parameters.Add('--init');
|
|
||||||
//p.Parameters.Add('--recursive');
|
|
||||||
p.CurrentDirectory:= fProject.basePath;
|
p.CurrentDirectory:= fProject.basePath;
|
||||||
p.Execute;
|
p.Execute;
|
||||||
processOutputToStrings(p,r);
|
processOutputToStrings(p,r);
|
||||||
for i := 0 to r.Count-1 do
|
for i := 0 to r.Count-1 do
|
||||||
fMsgs.message(r[i], fProject, amcProj, amkInf);
|
fMsgs.message(r[i], fProject, amcProj, amkAuto);
|
||||||
r.Clear;
|
while p.Running do
|
||||||
r.LoadFromStream(p.Stderr);
|
sleep(0);
|
||||||
|
p.Parameters.Clear;
|
||||||
|
p.Parameters.Add('submodule');
|
||||||
|
p.Parameters.Add('update');
|
||||||
|
p.Parameters.Add('--init');
|
||||||
|
p.Parameters.Add('--recursive');
|
||||||
|
p.Execute;
|
||||||
|
processOutputToStrings(p,r);
|
||||||
for i := 0 to r.Count-1 do
|
for i := 0 to r.Count-1 do
|
||||||
fMsgs.message(r[i], fProject, amcProj, amkErr);
|
fMsgs.message(r[i], fProject, amcProj, amkAuto);
|
||||||
end;
|
end;
|
||||||
finally;
|
finally;
|
||||||
actProjGitBranchesUpd.Execute;
|
actProjGitBranchesUpd.Execute;
|
||||||
|
@ -4069,25 +4069,15 @@ begin
|
||||||
p.Executable := exeFullName('git' + exeExt);
|
p.Executable := exeFullName('git' + exeExt);
|
||||||
if p.Executable.fileExists then
|
if p.Executable.fileExists then
|
||||||
begin
|
begin
|
||||||
p.Options := [poUsePipes, poNoConsole];
|
p.Options := [poUsePipes, poNoConsole, poStderrToOutPut];
|
||||||
p.ShowWindow:= swoHIDE;
|
p.ShowWindow:= swoHIDE;
|
||||||
p.Parameters.Add('checkout');
|
p.Parameters.Add('checkout');
|
||||||
p.Parameters.Add(b);
|
p.Parameters.Add(b);
|
||||||
p.CurrentDirectory:= fProject.basePath;
|
p.CurrentDirectory:= fProject.basePath;
|
||||||
p.Execute;
|
p.Execute;
|
||||||
processOutputToStrings(p,r);
|
processOutputToStrings(p,r);
|
||||||
r.Clear;
|
for i := 0 to r.Count-1 do
|
||||||
r.LoadFromStream(p.Stderr);
|
fMsgs.message(r[i], fProject, amcProj, amkAuto);
|
||||||
// git bug ? even on success they write the switch in stderr
|
|
||||||
if r.Count > 1 then
|
|
||||||
begin
|
|
||||||
for i := 0 to r.Count-1 do
|
|
||||||
fMsgs.message(r[i], fProject, amcProj, amkErr);
|
|
||||||
end
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
fMsgs.message('now on branch `' + b + '`', fProject, amcProj, amkInf);
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
finally;
|
finally;
|
||||||
actProjGitBranchesUpd.Execute;
|
actProjGitBranchesUpd.Execute;
|
||||||
|
@ -4138,9 +4128,8 @@ begin
|
||||||
end;
|
end;
|
||||||
r.Clear;
|
r.Clear;
|
||||||
r.LoadFromStream(p.Stderr);
|
r.LoadFromStream(p.Stderr);
|
||||||
if r.Count <> 0 then
|
for i := 0 to r.Count-1 do
|
||||||
for i := 0 to r.Count-1 do
|
fMsgs.message(r[i], fProject, amcProj, amkAuto);
|
||||||
fMsgs.message(r[i], fProject, amcProj, amkErr);
|
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
p.Free;
|
p.Free;
|
||||||
|
|
Loading…
Reference in New Issue