feat(healthcheck): git lfs with safe.directory
This commit is contained in:
		
							parent
							
								
									d19271c7ef
								
							
						
					
					
						commit
						8ca0125f23
					
				|  | @ -1,15 +1,27 @@ | ||||||
| package healthcheck | package healthcheck | ||||||
| 
 | 
 | ||||||
|  | import ( | ||||||
|  | 	"fmt" | ||||||
|  | 	"os/exec" | ||||||
|  | ) | ||||||
|  | 
 | ||||||
| func RepoLFS(rootDir string) error { | func RepoLFS(rootDir string) error { | ||||||
| 	// cmd := exec.Command("git", "lfs", "fsck", "--pointers")
 | 	cmd := exec.Command( | ||||||
| 	// cmd.Dir = rootDir
 | 		"git", | ||||||
| 	// output, err := cmd.CombinedOutput()
 | 		"-c", | ||||||
| 	// if err != nil {
 | 		"safe.directory=*", | ||||||
| 	// 	return fmt.Errorf(
 | 		"lfs", | ||||||
| 	// 		"error running `git lfs fsck --pointers`: %w, output: %s",
 | 		"fsck", | ||||||
| 	// 		err,
 | 		"--pointers", | ||||||
| 	// 		output,
 | 	) | ||||||
| 	// 	)
 | 	cmd.Dir = rootDir | ||||||
| 	// }
 | 	output, err := cmd.CombinedOutput() | ||||||
|  | 	if err != nil { | ||||||
|  | 		return fmt.Errorf( | ||||||
|  | 			"error running `git lfs fsck --pointers`: %w, output: %s", | ||||||
|  | 			err, | ||||||
|  | 			output, | ||||||
|  | 		) | ||||||
|  | 	} | ||||||
| 	return nil | 	return nil | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user