summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gitupdateunit.pas14
1 files 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);