Update DoPush() to user remote and branch
This commit is contained in:
22
main2.pb
22
main2.pb
@@ -977,19 +977,20 @@ Procedure DoPush()
|
||||
MessageRequester("Git Push", "Échec: " + #LF$ + "You Must tu have a remote", #PB_MessageRequester_Error)
|
||||
EndIf
|
||||
|
||||
If AddRemoteRepo(Trim(GetGadgetText(#GID_EdRemote)))
|
||||
|
||||
If Git("push -u origin "+GetGadgetText(#GID_CbRemoteBranch))
|
||||
AddRemoteRepo(Trim(GetGadgetText(#GID_EdRemote)))
|
||||
Protected target.s=GetGadgetText(#GID_CbRemoteBranch)
|
||||
Protected fp.l=FindString(target,"/",0)-1
|
||||
If fp>0
|
||||
target=Left(target,fp)+" "+Right(target,Len(target)-fp-1)
|
||||
EndIf
|
||||
If Git("push -u "+target)
|
||||
MessageRequester("Git Push", "OK:" + #LF$ + main\Gitcall\output, #PB_MessageRequester_Info)
|
||||
ProcedureReturn #True
|
||||
Else
|
||||
MessageRequester("Git Push", "Échec: " + #LF$ + main\Gitcall\errors, #PB_MessageRequester_Error)
|
||||
ProcedureReturn #False
|
||||
EndIf
|
||||
Else
|
||||
Debug"ZOOOOOOOOOOOOOOM"
|
||||
ProcedureReturn #False
|
||||
EndIf
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure.i GetRemoteStatusInfo()
|
||||
@@ -1665,7 +1666,8 @@ Procedure Main()
|
||||
; TODO: git pull
|
||||
|
||||
Case #GID_BtnPush
|
||||
SetGadgetText(#GID_TxtAction, T("Action.Push","Push demandé"))
|
||||
DoPush()
|
||||
GetRemoteStatusInfo()
|
||||
; TODO: git push
|
||||
|
||||
Case #GID_BtnVerify
|
||||
@@ -1704,8 +1706,8 @@ EndProcedure
|
||||
Main()
|
||||
|
||||
; IDE Options = PureBasic 6.21 (Windows - x64)
|
||||
; CursorPosition = 952
|
||||
; FirstLine = 948
|
||||
; CursorPosition = 981
|
||||
; FirstLine = 974
|
||||
; Folding = ----f--
|
||||
; EnableXP
|
||||
; DPIAware
|
Reference in New Issue
Block a user