mirror of
https://github.com/valitydev/repo-file-sync-action.git
synced 2024-11-06 01:45:19 +00:00
This commit is contained in:
parent
e84bc1e894
commit
ca2043bbbf
2
dist/index.js
vendored
2
dist/index.js
vendored
@ -21657,6 +21657,8 @@ class Git {
|
||||
return `\n${ string }`.split('\ndiff --git').slice(1).reduce((resultDict, fileDiff) => {
|
||||
const lines = fileDiff.split('\n')
|
||||
const lastHeaderLineIndex = lines.findIndex((line) => line.startsWith('+++'))
|
||||
if (lastHeaderLineIndex === -1) return resultDict // ignore binary files
|
||||
|
||||
const plainDiff = lines.slice(lastHeaderLineIndex + 1).join('\n').trim()
|
||||
let filePath = ''
|
||||
if (lines[lastHeaderLineIndex].startsWith('+++ b/')) { // every file except removed files
|
||||
|
@ -160,6 +160,8 @@ class Git {
|
||||
return `\n${ string }`.split('\ndiff --git').slice(1).reduce((resultDict, fileDiff) => {
|
||||
const lines = fileDiff.split('\n')
|
||||
const lastHeaderLineIndex = lines.findIndex((line) => line.startsWith('+++'))
|
||||
if (lastHeaderLineIndex === -1) return resultDict // ignore binary files
|
||||
|
||||
const plainDiff = lines.slice(lastHeaderLineIndex + 1).join('\n').trim()
|
||||
let filePath = ''
|
||||
if (lines[lastHeaderLineIndex].startsWith('+++ b/')) { // every file except removed files
|
||||
|
Loading…
Reference in New Issue
Block a user