Merge pull request #11022 from atom/windows-git-fixes

Windows git fixes
This commit is contained in:
Josh Abernathy
2016-03-01 22:16:43 -05:00
committed by joshaber
parent 435a01cb3e
commit 2e940b4426
2 changed files with 9 additions and 1 deletions

View File

@@ -37,7 +37,7 @@
"less-cache": "0.23",
"line-top-index": "0.2.0",
"marked": "^0.3.4",
"nodegit": "0.11.5",
"nodegit": "0.11.6",
"normalize-package-data": "^2.0.0",
"nslog": "^3",
"oniguruma": "^5",

View File

@@ -596,7 +596,15 @@ export default class GitRepositoryAsync {
.then(([repo, headCommit]) => Promise.all([repo, headCommit.getTree()]))
.then(([repo, tree]) => {
const options = new Git.DiffOptions()
options.contextLines = 0
options.flags = Git.Diff.OPTION.DISABLE_PATHSPEC_MATCH
options.pathspec = this.relativize(_path, repo.workdir())
if (process.platform === 'win32') {
// Ignore eol of line differences on windows so that files checked in
// as LF don't report every line modified when the text contains CRLF
// endings.
options.flags |= Git.Diff.OPTION.IGNORE_WHITESPACE_EOL
}
return Git.Diff.treeToWorkdir(repo, tree, options)
})
.then(diff => this._getDiffLines(diff))