mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-03 21:08:25 +00:00 
			
		
		
		
	Backport #19132 Make SKIP_TLS_VERIFY apply to git data migrations too through adding the `-c http.sslVerify=false` option to the git clone command. Fix #18998 Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
		@@ -97,15 +97,16 @@ func (repo *Repository) IsEmpty() (bool, error) {
 | 
			
		||||
 | 
			
		||||
// CloneRepoOptions options when clone a repository
 | 
			
		||||
type CloneRepoOptions struct {
 | 
			
		||||
	Timeout    time.Duration
 | 
			
		||||
	Mirror     bool
 | 
			
		||||
	Bare       bool
 | 
			
		||||
	Quiet      bool
 | 
			
		||||
	Branch     string
 | 
			
		||||
	Shared     bool
 | 
			
		||||
	NoCheckout bool
 | 
			
		||||
	Depth      int
 | 
			
		||||
	Filter     string
 | 
			
		||||
	Timeout       time.Duration
 | 
			
		||||
	Mirror        bool
 | 
			
		||||
	Bare          bool
 | 
			
		||||
	Quiet         bool
 | 
			
		||||
	Branch        string
 | 
			
		||||
	Shared        bool
 | 
			
		||||
	NoCheckout    bool
 | 
			
		||||
	Depth         int
 | 
			
		||||
	Filter        string
 | 
			
		||||
	SkipTLSVerify bool
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Clone clones original repository to target path.
 | 
			
		||||
@@ -128,6 +129,9 @@ func CloneWithArgs(ctx context.Context, from, to string, args []string, opts Clo
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	cmd := NewCommandContextNoGlobals(ctx, args...).AddArguments("clone")
 | 
			
		||||
	if opts.SkipTLSVerify {
 | 
			
		||||
		cmd.AddArguments("-c", "http.sslVerify=false")
 | 
			
		||||
	}
 | 
			
		||||
	if opts.Mirror {
 | 
			
		||||
		cmd.AddArguments("--mirror")
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user