Skip to content

Commit 5673273

Browse files
authored
Merge pull request #974 from bobeff/bugfix/line-endings
Fix the `doClone` procedure to clone a repository as is
2 parents 96df458 + b503ec2 commit 5673273

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/nimblepkg/download.nim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ proc doClone(meth: DownloadMethod, url, downloadDir: string, branch = "",
3535
depthArg = if onlyTip: "--depth 1" else: ""
3636
branchArg = if branch == "": "" else: &"-b {branch}"
3737
discard tryDoCmdEx(
38-
&"git clone --recursive {depthArg} {branchArg} {url} {downloadDir}")
38+
"git clone --config core.autocrlf=false --recursive " &
39+
&"{depthArg} {branchArg} {url} {downloadDir}")
3940
of DownloadMethod.hg:
4041
let
4142
tipArg = if onlyTip: "-r tip " else: ""
@@ -143,6 +144,7 @@ proc cloneSpecificRevision(downloadMethod: DownloadMethod,
143144
let downloadDir = downloadDir.quoteShell
144145
createDir(downloadDir)
145146
discard tryDoCmdEx(&"git -C {downloadDir} init")
147+
discard tryDoCmdEx(&"git -C {downloadDir} config core.autocrlf false")
146148
discard tryDoCmdEx(&"git -C {downloadDir} remote add origin {url}")
147149
discard tryDoCmdEx(
148150
&"git -C {downloadDir} fetch --depth 1 origin {vcsRevision}")

0 commit comments

Comments
 (0)