File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,22 +2,37 @@ package git
22
33import "fmt"
44
5- func checkPatchValidity (patchFile string ) error {
5+ func checkPatchValidity (filePath string ) error {
66 checkApplyArgs := append (
77 []string {
88 "apply" ,
99 "--check" ,
1010 },
11- patchFile ,
11+ filePath ,
1212 )
1313
1414 return executeGitCommand (checkApplyArgs )
1515}
1616
17+ func patchFile (filePath string ) error {
18+ patchFileArgs := append (
19+ []string {
20+ "apply" ,
21+ },
22+ filePath ,
23+ )
24+
25+ return executeGitCommand (patchFileArgs )
26+ }
27+
1728func ApplyPatches (filesToPatch []string ) error {
1829 for _ , filePath := range filesToPatch {
1930 if err := checkPatchValidity (filePath ); err != nil {
2031 fmt .Printf ("\t [Error] while trying to patch file %s : %s\n " , filePath , err .Error ())
32+ continue
33+ }
34+ if err := patchFile (filePath ); err != nil {
35+ fmt .Printf ("\t [Error] while trying to patch file %s : %s\n " , filePath , err .Error ())
2136 }
2237 }
2338
You can’t perform that action at this time.
0 commit comments