@@ -1631,6 +1631,28 @@ begin
1631
1631
WizardForm.ActiveControl:=EdtDefaultBranch;
1632
1632
end ;
1633
1633
1634
+ procedure DefaultBranchNameChanged (Sender: TObject);
1635
+ var
1636
+ IsValidBranchName:Boolean;
1637
+ begin
1638
+ if EdtDefaultBranch.Enabled then begin
1639
+ // Disallow illegal ref names
1640
+ with EdtDefaultBranch do
1641
+ IsValidBranchName:=(Text<>' ' ) and (Text<>' @' ) and
1642
+ (Pos(' ..' ,Text)=0 ) and (Pos(' @{' ,Text)=0 ) and (Pos(' //' ,Text)=0 ) and
1643
+ (Pos(#8 ,Text)=0 ) and (Pos(' ' ,Text)=0 ) and (Pos(' :' ,Text)=0 ) and
1644
+ (Pos(' ?' ,Text)=0 ) and (Pos(' [' ,Text)=0 ) and (Pos(' \' ,Text)=0 ) and
1645
+ (Pos(' ^' ,Text)=0 ) and (Pos(' ~' ,Text)=0 ) and (Pos(#127 ,Text)=0 ) and
1646
+ (Pos(' /.' ,' /' +Text)=0 ) and (Pos(' ./' ,Text+' /' )=0 ) and (Pos(' .lock/' ,Text+' /' )=0 );
1647
+ if (WizardForm.CurPageID=DefaultBranchPage.ID) then
1648
+ Wizardform.NextButton.Enabled:=IsValidBranchName;
1649
+ if IsValidBranchName then
1650
+ EdtDefaultBranch.Color:=clWhite
1651
+ else
1652
+ EdtDefaultBranch.Color:=clRed;
1653
+ end ;
1654
+ end ;
1655
+
1634
1656
procedure QueryUninstallValues ; forward ;
1635
1657
1636
1658
procedure InitializeWizard ;
@@ -1888,6 +1910,7 @@ begin
1888
1910
TabOrder:=TabOrder+1 ;
1889
1911
EdtDefaultBranch.Text:=' main' ;
1890
1912
EdtDefaultBranch.Enabled:=False;
1913
+ EdtDefaultBranch.OnChange:=@DefaultBranchNameChanged;
1891
1914
Top:=Top+13 +24 ;
1892
1915
1893
1916
LblInfo:=TLabel.Create(DefaultBranchPage);
@@ -1899,11 +1922,13 @@ begin
1899
1922
// Restore the setting chosen during a previous install.
1900
1923
Data:=ReplayChoice(' Default Branch Option' ,' ' );
1901
1924
case Data of
1902
- ' ' : RdbDefaultBranch[DB_Unspecified].Checked:=True;
1925
+ ' ' : RdbDefaultBranch[DB_Unspecified].Checked:=True;
1926
+ ' ' : RdbDefaultBranch[DB_Unspecified].Checked:=True;
1903
1927
else begin
1904
1928
RdbDefaultBranch[DB_Manual].Checked:=True;
1905
1929
EdtDefaultBranch.Text:=Data;
1906
1930
EdtDefaultBranch.Enabled:=True;
1931
+ DefaultBranchNameChanged(NIL );
1907
1932
end end ;
1908
1933
1909
1934
(*
@@ -3162,7 +3187,7 @@ begin
3162
3187
RecordChoice(PreviousDataKey,' Custom Editor Path' ,CustomEditorData);
3163
3188
3164
3189
// Default Branch options.
3165
- Data:=' ' ;
3190
+ Data:=' ' ;
3166
3191
if RdbDefaultBranch[DB_Manual].Checked then
3167
3192
Data:=EdtDefaultBranch.Text;
3168
3193
RecordChoice(PreviousDataKey,' Default Branch Option' ,Data);
0 commit comments