add PushLocalRepository()

This commit is contained in:
Gerhard Hoffmann 2024-03-14 15:05:01 +01:00
parent 9d590039aa
commit f56e10a24e
6 changed files with 11 additions and 2 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -15,6 +15,8 @@ var
LocalBranchName: array[0..32] of char;
FileToCommit: array[0..128] of char;
CommitMessage: array[0..256] of char;
UserName: array[0..64] of char;
PassWord: array[0..64] of char;
begin
// TariffCalc := NewTariffCalculator;
@ -25,6 +27,8 @@ begin
LocalBranchName := 'zg1/zone1';
FileToCommit := 'etc/psa_tariff/tariff01.json';
CommitMessage := 'TEST TEST';
UserName := 'GerhardHoffmann';
PassWord := 'ghlinux12345';
if not DirectoryExistsUTF8(ExpandFilenameUtf8(LocalCustomerRepo)) then
CreateDirUTF8(ExpandFilenameUtf8(LocalCustomerRepo));
@ -36,7 +40,9 @@ begin
if not CheckoutLocalBranch(LocalCustomerRepo, LocalBranchName) = 0 then
writeLn('cannot check out') ;
if not CommitFile(LocalCustomerRepo, LocalBranchName, FileToCommit, CommitMessage) = 0 then
writeLn('cannot check out') ;
writeLn('cannot commit') ;
if not PushLocalRepository(LocalCustomerRepo, LocalBranchName, UserName, PassWord) = 0 then
writeLn('cannot push') ;
Finally
if ShutdownGitLibrary() >= 0 then
writeLn('shutdown git library') ;

View File

@ -21,7 +21,8 @@ function CloneRepository(var url; var local_path) : cint32; stdcall;
function CheckoutLocalBranch(var local_path; var branch_name) : cint32; stdcall;
function CommitFile(var local_path; var branch_name;
var file_name; var comment) : cint32; stdcall;
function PushLocalRepository(var local_path; var branch_name;
var user_name; var password) : cint32; stdcall;
implementation
const
@ -36,6 +37,8 @@ function CloneRepository(var url; var local_path) : cint32; stdcall; external DL
function CheckoutLocalBranch(var local_path; var branch_name) : cint32; stdcall; external DLLName;
function CommitFile(var local_path; var branch_name;
var file_name; var comment) : cint32; stdcall; external DLLName;
function PushLocalRepository(var local_path; var branch_name;
var user_name; var password) : cint32; stdcall; external DLLName;
end.