[CODE-1299] fix diff git with double quotes name (#959)

eb/code-1016-2
Enver Bisevac 2024-01-12 19:24:31 +00:00 committed by Harness
parent 74def977f2
commit 13b89482f2
1 changed files with 1 additions and 1 deletions

View File

@ -240,7 +240,7 @@ func (p *Parser) parseFileHeader() (*File, error) {
// NOTE: In case file name is surrounded by double quotes (it happens only in
// git-shell). e.g. diff --git "a/xxx" "b/xxx"
hasQuote := line[len(diffHead)] == '"'
hasQuote := line[len(diffHead)] == '"' || line[len(line)-1] == '"'
middle := strings.Index(line, ` b/`)
if hasQuote {
middle = strings.Index(line, ` "b/`)