소스 검색

Merge pull request #1198 from postHawk/fix-1185

#1185 fix windows git working directory
pull/1197/head
Fred Hebert 9 년 전
부모
커밋
3dc62dba5d
1개의 변경된 파일9개의 추가작업 그리고 2개의 파일을 삭제
  1. +9
    -2
      src/rebar_git_resource.erl

+ 9
- 2
src/rebar_git_resource.erl 파일 보기

@ -18,9 +18,16 @@ lock(AppDir, {git, Url, _}) ->
lock(AppDir, {git, Url}); lock(AppDir, {git, Url});
lock(AppDir, {git, Url}) -> lock(AppDir, {git, Url}) ->
AbortMsg = io_lib:format("Locking of git dependency failed in ~s", [AppDir]), AbortMsg = io_lib:format("Locking of git dependency failed in ~s", [AppDir]),
Dir = rebar_utils:escape_double_quotes(AppDir),
{ok, VsnString} = {ok, VsnString} =
rebar_utils:sh("git --git-dir=\"" ++ rebar_utils:escape_double_quotes(AppDir) ++ "/.git\" rev-parse --verify HEAD",
[{use_stdout, false}, {debug_abort_on_error, AbortMsg}]),
case os:type() of
{win32, _} ->
rebar_utils:sh("git rev-parse --git-dir=\"" ++ Dir ++ "/.git\" --work-tree=\"" ++ Dir ++ "\" --verify HEAD",
[{use_stdout, false}, {debug_abort_on_error, AbortMsg}]);
_ ->
rebar_utils:sh("git --git-dir=\"" ++ Dir ++ "/.git\" rev-parse --verify HEAD",
[{use_stdout, false}, {debug_abort_on_error, AbortMsg}])
end,
Ref = string:strip(VsnString, both, $\n), Ref = string:strip(VsnString, both, $\n),
{git, Url, {ref, Ref}}. {git, Url, {ref, Ref}}.

불러오는 중...
취소
저장