소스 검색

Use cwd in command args instead of spawn args

Some git services are ok with using paths in args instead of previously
specifying it in spawning processes.
master
부모
커밋
7d542ad350
1개의 변경된 파일8개의 추가작업 그리고 8개의 파일을 삭제
  1. +8
    -8
      src/modules/git/Git.service.ts

+ 8
- 8
src/modules/git/Git.service.ts 파일 보기

@@ -26,29 +26,29 @@ export class GitServiceImpl implements GitService {

async advertiseReceivePackRefs(cwd: string): Promise<ChildProcess> {
const command = GitServiceImpl.isWindows() ? 'git' : 'git-receive-pack';
const commonArgs = ['--stateless-rpc', '--advertise-refs', '.'];
const commonArgs = ['--stateless-rpc', '--advertise-refs', cwd];
const args = GitServiceImpl.isWindows() ? ['receive-pack', ...commonArgs] : commonArgs;
return spawn(command, args, { cwd });
return spawn(command, args);
}

async advertiseUploadPackRefs(cwd: string): Promise<ChildProcess> {
const command = GitServiceImpl.isWindows() ? 'git' : 'git-upload-pack';
const commonArgs = ['--stateless-rpc', '--advertise-refs', '.'];
const commonArgs = ['--stateless-rpc', '--advertise-refs', cwd];
const args = GitServiceImpl.isWindows() ? ['upload-pack', ...commonArgs] : commonArgs;
return spawn(command, args, { cwd });
return spawn(command, args);
}

async receivePack(cwd: string): Promise<ChildProcess> {
const command = GitServiceImpl.isWindows() ? 'git' : 'git-receive-pack';
const commonArgs = ['--stateless-rpc', '.'];
const commonArgs = ['--stateless-rpc', cwd];
const args = GitServiceImpl.isWindows() ? ['receive-pack', ...commonArgs] : commonArgs;
return spawn(command, args, { cwd });
return spawn(command, args);
}

async uploadPack(cwd: string): Promise<ChildProcess> {
const command = GitServiceImpl.isWindows() ? 'git' : 'git-upload-pack';
const commonArgs = ['--stateless-rpc', '.'];
const commonArgs = ['--stateless-rpc', cwd];
const args = GitServiceImpl.isWindows() ? ['upload-pack', ...commonArgs] : commonArgs;
return spawn(command, args, { cwd });
return spawn(command, args);
}
}

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