anchor.diff:          "GIT_DIR=~s git archive heads/~s |tar -x -C ~s",
           [Package, Branch, ExportPath]
       ),
  -    case os:cmd(ExportBranch) of
  +    case command(ExportBranch) of
           [] -> ok;
           Error -> {error, Error}
       end.
  
positive.code: 
  is_branch(_State, Package, Branch) ->
      IsBranch = format("GIT_DIR=~s git rev-parse heads/~s 1> /dev/null", [Package, Branch]),
      case os:cmd(IsBranch) of
          [] -> true;
          Error ->
              error_logger:info_msg("not a branch: ~s~n", [Error]),
              false
      end.
  
negative.code: 
  get_branches(_State, Package) ->
      GetBranches = format("GIT_DIR=~s git branch", [Package]),
      case command(GetBranches) of
          {error, _}=Error -> Error;
          {ok, <<>>} -> {ok, []};
          {ok, Result} -> 
              {ok, [Branch || Branch <- binary:split(Result, <<"\n">>, [global]), Branch /= <<>>]}
      end.
  
  
  get_diff(_State, Package, _Branch, Revno, NewRevno) when Revno == none; Revno == error ->
      Revisions = command(format("GIT_DIR=~s git rev-list --all", [Package])),
      First = lists:last(string:tokens(Revisions, "\n")),
      DiffCmd = format("GIT_DIR=~s git diff ~s ~s", [Package, First, NewRevno]),
      case command(DiffCmd) of
          {error, _} = Error -> Error; 
          {ok, Diff} ->
              Size = size(Diff),
              if
                  Size > 10240 -> {ok, binary:part(Diff, 0, 10239)};
                  true -> {ok, Diff}
              end
      end;
  
  
  get_diff(_State, Package, _Branch, OldRevno, NewRevno) ->
      DiffCmd = format("GIT_DIR=~s git diff ~s ~s", [Package, OldRevno, NewRevno]),
      case command(DiffCmd) of 
          {error, _} = Error -> Error;
          {ok, Diff} ->
              Size = size(Diff),
              if
                  Size > 10240 -> {ok, binary:part(Diff, 0, 10239)};
                  true -> {ok, Diff}
              end
      end.
  
  
  get_changelog(_State, Package, _Branch, Revno, NewRevno) when Revno == none; Revno == error ->
      LogCmd = format("GIT_DIR=~s git log ~s", [Package, NewRevno]),
      case command(LogCmd) of
          {error, _} = Error -> Error;
          {ok, Log} ->
              Size = size(Log),
              if
                  Size > 10240 -> {ok, binary:part(Log, 0, 10239)};
                  true -> {ok, Log}
              end
      end;
  
  get_changelog(_State, Package, _Branch, OldRevno, NewRevno) ->
      LogCmd = format("GIT_DIR=~s git log ~s..~s", [Package, OldRevno, NewRevno]),
      case command(LogCmd) of
          {error, _} = Error -> Error;
          {ok, Log} ->
              Size = size(Log),
              if
                  Size > 10240 -> {ok, binary:part(Log, 0, 10239)};
                  true -> {ok, Log}
              end
      end.
  
  
  get_tag(_State, Package, _Branch, NewRevno) ->
      TagCmd = format("GIT_DIR=~s git describe --exact-match ~s 2> /dev/null", [Package, NewRevno]),
      case command(TagCmd) of
          [] -> {ok, none};
          Tag -> {ok, string:strip(Tag, right, $\n)}
      end.
  