File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -207,7 +207,15 @@ func handleSettingsPostUpdate(ctx *context.Context) {
207207	repo .Website  =  form .Website 
208208	repo .IsTemplate  =  form .Template 
209209
210- 	if  err  :=  repo_service .UpdateRepository (ctx , repo , false ); err  !=  nil  {
210+ 	// Visibility of forked repository is forced sync with base repository. 
211+ 	visibilityChanged  :=  false 
212+ 	if  repo .IsFork  {
213+ 		preVisibility  :=  repo .IsPrivate 
214+ 		repo .IsPrivate  =  repo .BaseRepo .IsPrivate  ||  repo .BaseRepo .Owner .Visibility  ==  structs .VisibleTypePrivate 
215+ 		visibilityChanged  =  preVisibility  !=  repo .IsPrivate 
216+ 	}
217+ 
218+ 	if  err  :=  repo_service .UpdateRepository (ctx , repo , visibilityChanged ); err  !=  nil  {
211219		ctx .ServerError ("UpdateRepository" , err )
212220		return 
213221	}
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments