feat/reposize #56
| 
						 | 
				
			
			@ -10,7 +10,7 @@ import (
 | 
			
		|||
 | 
			
		||||
// RepoSize checks the size of the repository to determine if it is oversized.
 | 
			
		||||
// It executes the 'git count-objects -v' command to obtain the size information,
 | 
			
		||||
func RepoSize(conf_size float64) error {
 | 
			
		||||
func RepoSize(confSize float64) error {
 | 
			
		||||
| 
					
	
	
	
	
	
	
	
	 
					
					zzjc123 marked this conversation as resolved
					
						
						
							Outdated
						
					
				 
				 | 
			||||
	// TODO: reimplement here when go-git is available
 | 
			
		||||
	// https://github.com/go-git/go-git/blob/master/COMPATIBILITY.md
 | 
			
		||||
	cmd := exec.Command("git", "count-objects", "-v")
 | 
			
		||||
| 
						 | 
				
			
			@ -33,8 +33,8 @@ func RepoSize(conf_size float64) error {
 | 
			
		|||
			sum += size
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	if sum > int(conf_size*1024) {
 | 
			
		||||
		return fmt.Errorf("Repository larger than %.1f Mib. Please clean up or contact the teaching team.", conf_size)
 | 
			
		||||
	if sum > int(confSize*1024) {
 | 
			
		||||
		return fmt.Errorf("Repository larger than %.1f Mib. Please clean up or contact the teaching team.", confSize)
 | 
			
		||||
| 
					
	
	
	
	
	
	
	
	 
					
					zzjc123 marked this conversation as resolved
					
						
						
							Outdated
						
					
				 
				
				
					
						张泊明518370910136
						commented  
			
		We should use  We should use `%.1f Mib` here for clearance. 
			
			
		 | 
			||||
	}
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user
	
We use camel case for variables in Go project.