Merge pull request #1069 from atom/ks-git-on-windows

Get git working on windows
This commit is contained in:
Kevin Sawicki
2013-11-01 14:01:55 -07:00
4 changed files with 12 additions and 4 deletions

1
.gitignore vendored
View File

@@ -5,6 +5,7 @@
.nvm-version
node_modules
npm-debug.log
debug.log
/tags
/atom-shell/
docs/output

View File

@@ -20,7 +20,7 @@
"first-mate": "0.5.0",
"fs-plus": "0.7.0",
"fuzzaldrin": "0.1.0",
"git-utils": "0.28.0",
"git-utils": "0.29.0",
"guid": "0.0.10",
"jasmine-focused": "~0.15.0",
"mkdirp": "0.3.5",
@@ -80,7 +80,7 @@
"dev-live-reload": "0.13.0",
"editor-stats": "0.5.0",
"exception-reporting": "0.5.0",
"find-and-replace": "0.35.0",
"find-and-replace": "0.36.0",
"fuzzy-finder": "0.19.0",
"gists": "0.6.0",
"git-diff": "0.13.0",
@@ -103,7 +103,7 @@
"terminal": "0.15.0",
"timecop": "0.9.0",
"to-the-hubs": "0.8.0",
"tree-view": "0.25.0",
"tree-view": "0.26.0",
"visual-bell": "0.3.0",
"whitespace": "0.8.0",
"wrap-guide": "0.4.0",

View File

@@ -65,6 +65,9 @@ class Directory
relativize: (fullPath) ->
return fullPath unless fullPath
# Normalize forward slashes to back slashes on windows
fullPath = fullPath.replace(/\//g, '\\') if process.platform is 'win32'
if fullPath is @getPath()
''
else if fullPath.indexOf(path.join(@getPath(), path.sep)) is 0

View File

@@ -235,7 +235,11 @@ class Git
#
# Returns an object with two keys, `ahead` and `behind`. These will always be
# greater than zero.
getLineDiffs: (path, text) -> @getRepo().getLineDiffs(@relativize(path), text)
getLineDiffs: (path, text) ->
# 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 = ignoreEolWhitespace: process.platform is 'win32'
@getRepo().getLineDiffs(@relativize(path), text, options)
# Public: Returns the git configuration value specified by the key.
getConfigValue: (key) -> @getRepo().getConfigValue(key)