Skip to content

Commit 0494629

Browse files
author
José Valim
committed
Properly convert from list to string in git commands
1 parent 941ce75 commit 0494629

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/mix/lib/mix/scm/git.ex

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,12 @@ defmodule Mix.SCM.Git do
214214
end
215215
end
216216

217+
@rev_command 'git --git-dir=.git config remote.origin.url && git --git-dir=.git rev-parse --verify --quiet HEAD'
218+
217219
defp get_rev_info do
218220
destructure [origin, rev],
219-
:os.cmd('git --git-dir=.git config remote.origin.url && git --git-dir=.git rev-parse --verify --quiet HEAD')
220-
|> IO.iodata_to_binary
221+
:os.cmd(@rev_command)
222+
|> List.to_string()
221223
|> String.split("\n", trim: true)
222224
%{origin: origin, rev: rev}
223225
end
@@ -257,7 +259,7 @@ defmodule Mix.SCM.Git do
257259
:error ->
258260
version =
259261
:os.cmd('git --version')
260-
|> IO.iodata_to_binary
262+
|> List.to_string()
261263
|> parse_version
262264

263265
Mix.State.put(:git_version, version)

0 commit comments

Comments
 (0)