initCachedLocalAndRemoteGit function

Future<(Directory, Directory)> initCachedLocalAndRemoteGit()

Cached variant of initLocalAndRemoteGit: same result, but built once per isolate. Every call returns a fresh copy with a rewired origin.

Implementation

Future<(Directory local, Directory remote)> initCachedLocalAndRemoteGit() =>
    initCachedRepoPair(
      key: 'gg_git/initLocalAndRemoteGit',
      build: (local, remote) async {
        await initLocalGit(local);
        await initRemoteGit(remote);
        await addRemoteToLocal(local: local, remote: remote);
      },
    );