Showing the changes to node_modules/simple-git/src/responses/FileStatusSummary.js (1 of 41 files). Show all
Unified · Split
| @@ -0,0 +1,22 @@ | |||
| 1 | 'use strict'; | ||
| 2 | |||
| 3 | function FileStatusSummary (path, index, working_dir) { | ||
| 4 | this.path = path; | ||
| 5 | this.index = index; | ||
| 6 | this.working_dir = working_dir; | ||
| 7 | |||
| 8 | if ('R' === index + working_dir) { | ||
| 9 | var detail = FileStatusSummary.fromPathRegex.exec(path) || [null, path, path]; | ||
| 10 | this.from = detail[1]; | ||
| 11 | this.path = detail[2]; | ||
| 12 | } | ||
| 13 | } | ||
| 14 | |||
| 15 | FileStatusSummary.fromPathRegex = /^(.+) -> (.+)$/; | ||
| 16 | |||
| 17 | FileStatusSummary.prototype = { | ||
| 18 | path: '', | ||
| 19 | from: '' | ||
| 20 | }; | ||
| 21 | |||
| 22 | module.exports = FileStatusSummary; | ||