From 281ea5eb2424f8ec494cb76bb298e178e78a4cc1 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 22 Feb 2018 17:18:50 +0100 Subject: gitupdateunit.pas: --porcellain fuer git --- gitupdateunit.pas | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/gitupdateunit.pas b/gitupdateunit.pas index 842ba77..66d0201 100644 --- a/gitupdateunit.pas +++ b/gitupdateunit.pas @@ -27,14 +27,20 @@ initialization output:=''; for i:=0 to length(gitDirs)-1 do begin + updated:=updated or (sourceSha512Sum(gitDirs[i])<>binarySha512Sum(i)); + setLength(args,3); + args[0]:='status'; + args[1]:='-sb'; + args[2]:='--porcelain'; + if not runCommandInDir(gitDirs[i],'git',args,output) then continue; + output:=trim(output); + if pos(' [behind ',output)=0 then + continue; setLength(args,2); args[0]:='pull'; args[1]:='--all'; if not runCommandInDir(gitDirs[i],'git',args,output) then continue; - output:=trim(output); - while pos(#10,output)>0 do - erstesArgument(output,#10); - updated:=updated or (output<>'Already up-to-date.') or (sourceSha512Sum(gitDirs[i])<>binarySha512Sum(i)); + updated:=true; end; if updated then refreshExecutable(gitDirs); -- cgit v1.2.3-70-g09d2