@@ -355,7 +355,7 @@ func (tp *tagpr) Run(ctx context.Context) error {
355355 }
356356
357357 // Detect modified files and create a new tree object
358- diffFiles , _ , err := tp .c .Git ("diff" , "--name-status " , "HEAD" )
358+ diffFiles , _ , err := tp .c .Git ("diff" , "--raw " , "HEAD" )
359359 if err != nil {
360360 return err
361361 }
@@ -364,12 +364,15 @@ func (tp *tagpr) Run(ctx context.Context) error {
364364 if strings .TrimSpace (line ) == "" {
365365 continue
366366 }
367+ if ! strings .HasPrefix (line , ":" ) {
368+ continue
369+ }
367370 parts := strings .Fields (line )
368- if len (parts ) < 2 {
371+ if len (parts ) < 6 {
369372 continue
370373 }
371374
372- status , filePath := parts [0 ], parts [1 ]
375+ newMode , status , filePath := parts [1 ], parts [4 ], parts [ 5 ]
373376 switch status {
374377 case "A" , "M" : // Created or modified files
375378 contentBytes , err := os .ReadFile (filePath )
@@ -380,7 +383,7 @@ func (tp *tagpr) Run(ctx context.Context) error {
380383 Path : github .Ptr (filePath ),
381384 Type : github .Ptr ("blob" ),
382385 Content : github .Ptr (string (contentBytes )),
383- Mode : github .Ptr ("100644" ),
386+ Mode : github .Ptr (newMode ),
384387 })
385388 case "D" : // Deleted files
386389 treeEntries = append (treeEntries , & github.TreeEntry {
0 commit comments