File tree Expand file tree Collapse file tree 2 files changed +15
-16
lines changed Expand file tree Collapse file tree 2 files changed +15
-16
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,8 @@ func CreateBranchFromIssue(ctx *context.Context) {
4040	form  :=  web .GetForm (ctx ).(* forms.NewBranchForm )
4141	repo  :=  ctx .Repo .Repository 
4242	gitRepo  :=  ctx .Repo .GitRepo 
43- 	if  form .RepoID  >  0  {
43+ 	// if create branch in a forked repository 
44+ 	if  form .RepoID  >  0  &&  form .RepoID  !=  repo .ID  {
4445		var  err  error 
4546		repo , err  =  repo_model .GetRepositoryByID (ctx , form .RepoID )
4647		if  err  !=  nil  {
Original file line number Diff line number Diff line change 5757			<form class="ui form form-fetch-action" action="{{.Issue.Link}}/create_branch"
5858				method="post">
5959				{{.CsrfTokenHtml}}
60- 				<div class="field">
60+ 				<div class="required  field">
6161					<label for="new_branch_name">{{ctx.Locale.Tr "form.NewBranchName"}}</label>
62- 					<input name="new_branch_name" type="text">
62+ 					<input name="new_branch_name" type="text" required >
6363				</div>
6464
65- 				<div class="field">
65+ 				<div class="required  field">
6666					<label for="source_repository">{{ctx.Locale.Tr "repo.issues.create_branch_from_repository"}}</label>
6767					<div class="ui fluid dropdown selection">
6868						<select name="repo_id">
8282					</div>
8383				</div>
8484
85- 				<div class="field">
85+ 				<div class="required  field">
8686					<label for="source_branch_name">{{ctx.Locale.Tr "repo.issues.base_branch"}}</label>
87- 					<div class="ui fluid dropdown selection">
88- 						<select name="source_branch_name">
89- 							{{range .Branches}}
90- 								<option value="{{.}}">{{.}}</option>
91- 							{{end}}
92- 						</select>
87+ 					<div class="ui selection dropdown">
88+ 						<input type="hidden" id="source_branch_name" name="source_branch_name" value="{{.Issue.Repo.DefaultBranch}}" required>
89+ 						<span class="text truncated-item-container" data-value="{{.Issue.Repo.DefaultBranch}}" title="{{.Issue.Repo.DefaultBranch}}">
90+ 							<span class="truncated-item-name">{{.Issue.Repo.DefaultBranch}}</span>
91+ 						</span>
9392						{{svg "octicon-triangle-down" 14 "dropdown icon"}}
94- 
95- 						<div class="default text"> </div>
96- 
97- 						<div class="menu tw-overflow-hidden tw-max-w-full">
93+ 						<div class="menu">
9894							{{range .Branches}}
99- 								<div data-value="{{.}}" data-tooltip-content="{{.}}" class="item tw-overflow-hidden gt-ellipsis tw-whitespace-nowrap">{{.}}</div>
95+ 								<div class="item truncated-item-container" data-value="{{.}}" title="{{.}}">
96+ 									<span class="truncated-item-name">{{.}}</span>
97+ 								</div>
10098							{{end}}
10199						</div>
102100					</div>
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments