Skip to content

Commit 407427f

Browse files
author
José Valim
committed
Take into get_rev_info command may fail when not in a git repository
1 parent 2b2d9dc commit 407427f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,10 @@ defmodule Mix.SCM.Git do
143143
end
144144

145145
defp get_rev_info do
146-
[origin, rev] = System.cmd('git config remote.origin.url && git rev-parse --verify --quiet HEAD')
147-
|> iolist_to_binary
148-
|> String.split("\n", trim: true)
146+
destructure [origin, rev],
147+
System.cmd('git config remote.origin.url && git rev-parse --verify --quiet HEAD')
148+
|> iolist_to_binary
149+
|> String.split("\n", trim: true)
149150
[ origin: origin, rev: rev ]
150151
end
151152

0 commit comments

Comments
 (0)