class CommitController extends AbstractRepositoryController {

	@PostMapping("/repos/{owner}/{repoName}/stage-changes")
	public ResponseEntity<Map<String, Object>> stageChanges(
			Principal principal,
			@PathVariable("owner") String owner,
			@PathVariable("repoName") String repoName,
			@RequestBody String[] param) {
		// 必须要先登录
		if(principal == null) {
			throw new NoAuthorizationException();
		}
		Repository repository = repositoryService.find(owner, repoName).orElseThrow(ResourceNotFoundException::new);
		repositoryPermissionService.canWrite(principal, repository).orElseThrow(NoAuthorizationException::new);
		
		repositoryResourceService.stageChanges(repository, param);
		
		return ResponseEntity.ok(Collections.emptyMap());
	}

}