Skip to content

Commit

Permalink
Match across newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
joshaber committed Nov 8, 2017
1 parent 8ca0149 commit b219f8f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/src/lib/status-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function parsePorcelainStatus(
}

// 1 <XY> <sub> <mH> <mI> <mW> <hH> <hI> <path>
const changedEntryRe = /^1 ([MADRCU?!.]{2}) (N\.\.\.|S[C.][M.][U.]) (\d+) (\d+) (\d+) ([a-f0-9]+) ([a-f0-9]+) (.*?)$/
const changedEntryRe = /^1 ([MADRCU?!.]{2}) (N\.\.\.|S[C.][M.][U.]) (\d+) (\d+) (\d+) ([a-f0-9]+) ([a-f0-9]+) ([\s\S]*?)$/

function parseChangedEntry(field: string): IStatusEntry {
const match = changedEntryRe.exec(field)
Expand All @@ -92,7 +92,7 @@ function parseChangedEntry(field: string): IStatusEntry {
}

// 2 <XY> <sub> <mH> <mI> <mW> <hH> <hI> <X><score> <path><sep><origPath>
const renamedOrCopiedEntryRe = /^2 ([MADRCU?!.]{2}) (N\.\.\.|S[C.][M.][U.]) (\d+) (\d+) (\d+) ([a-f0-9]+) ([a-f0-9]+) ([RC]\d+) (.*?)$/
const renamedOrCopiedEntryRe = /^2 ([MADRCU?!.]{2}) (N\.\.\.|S[C.][M.][U.]) (\d+) (\d+) (\d+) ([a-f0-9]+) ([a-f0-9]+) ([RC]\d+) ([\s\S]*?)$/

function parsedRenamedOrCopiedEntry(
field: string,
Expand Down Expand Up @@ -121,7 +121,7 @@ function parsedRenamedOrCopiedEntry(
}

// u <xy> <sub> <m1> <m2> <m3> <mW> <h1> <h2> <h3> <path>
const unmergedEntryRe = /^u ([DAU]{2}) (N\.\.\.|S[C.][M.][U.]) (\d+) (\d+) (\d+) (\d+) ([a-f0-9]+) ([a-f0-9]+) ([a-f0-9]+) (.*?)$/
const unmergedEntryRe = /^u ([DAU]{2}) (N\.\.\.|S[C.][M.][U.]) (\d+) (\d+) (\d+) (\d+) ([a-f0-9]+) ([a-f0-9]+) ([a-f0-9]+) ([\s\S]*?)$/

function parseUnmergedEntry(field: string): IStatusEntry {
const match = unmergedEntryRe.exec(field)
Expand Down

0 comments on commit b219f8f

Please sign in to comment.