gitClone method

Future<({String? branch, String head})> gitClone(
  1. String url, {
  2. String? branch,
  3. int? depth,
  4. bool bare = false,
})

Clones url into the served root, returning the resulting head SHA and the checked-out branch.

Implementation

Future<({String head, String? branch})> gitClone(
  String url, {
  String? branch,
  int? depth,
  bool bare = false,
}) async {
  final reply = await _call(
    DriveOp.gitClone,
    fields: {
      'url': url,
      'branch': ?branch,
      'depth': ?depth,
      if (bare) 'bare': true,
    },
  );
  return (
    head: reply.header['head'] as String,
    branch: reply.header['branch'] as String?,
  );
}