From 08822651a60cd4bfcc700fcff81a42acf9f26cd7 Mon Sep 17 00:00:00 2001
From: Giteabot <teabot@gitea.io>
Date: Fri, 19 Apr 2024 23:16:02 +0800
Subject: [PATCH] Fix commit file status parser (#30602) (#30606)

Backport #30602 by wxiaoguang

Try to fix  #30492

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
---
 modules/git/commit.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/git/commit.go b/modules/git/commit.go
index 4ff8f6148f..a5382fcffd 100644
--- a/modules/git/commit.go
+++ b/modules/git/commit.go
@@ -459,7 +459,7 @@ func parseCommitFileStatus(fileStatus *CommitFileStatus, stdout io.Reader) {
 		_, _ = rd.Discard(1)
 	}
 	for {
-		modifier, err := rd.ReadSlice('\x00')
+		modifier, err := rd.ReadString('\x00')
 		if err != nil {
 			if err != io.EOF {
 				log.Error("Unexpected error whilst reading from git log --name-status. Error: %v", err)