mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 21:28:11 +09:00 
			
		
		
		
	Only use SHA256 feature when git >= 2.42 (#28466)
And fix some comments
This commit is contained in:
		| @@ -63,7 +63,7 @@ func IsRepoURLAccessible(ctx context.Context, url string) bool { | ||||
| 	return err == nil | ||||
| } | ||||
|  | ||||
| // GetObjectFormatOfRepo returns the hash type of a repository at a given path | ||||
| // GetObjectFormatOfRepo returns the hash type of repository at a given path | ||||
| func GetObjectFormatOfRepo(ctx context.Context, repoPath string) (ObjectFormat, error) { | ||||
| 	var stdout, stderr strings.Builder | ||||
|  | ||||
| @@ -96,7 +96,10 @@ func InitRepository(ctx context.Context, repoPath string, bare bool, objectForma | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	cmd := NewCommand(ctx, "init", "--object-format").AddDynamicArguments(objectFormat.String()) | ||||
| 	cmd := NewCommand(ctx, "init") | ||||
| 	if SupportHashSha256 { | ||||
| 		cmd.AddOptionValues("--object-format", objectFormat.String()) | ||||
| 	} | ||||
| 	if bare { | ||||
| 		cmd.AddArguments("--bare") | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user