|
@@ -217,8 +217,12 @@ async def summaryCommit(request: RequestBody, background_tasks: BackgroundTasks)
|
|
local_path, repo_name = generate_repo_path(request.uuid, request.repo_url)
|
|
local_path, repo_name = generate_repo_path(request.uuid, request.repo_url)
|
|
repo=await Repos.get(name=repo_name)
|
|
repo=await Repos.get(name=repo_name)
|
|
repo_id=repo.id
|
|
repo_id=repo.id
|
|
|
|
+ repo_commit=await Commit_Summary_Tasks.get(repo_id=repo_id)
|
|
|
|
+ repo_commit_hash=repo_commit.repo_hash
|
|
|
|
+ print(f"开始提交仓库: {repo_name}")
|
|
await Commit_Summary_Tasks.filter(repo_id=repo_id).update(start_time=int(time.time()))
|
|
await Commit_Summary_Tasks.filter(repo_id=repo_id).update(start_time=int(time.time()))
|
|
- commit_content = Repo(local_path).git.log('-1', '-p', '--pretty=format:%h %s')
|
|
|
|
|
|
+ # commit_content = Repo(local_path).git.log('-1', '-p', '--pretty=format:%h %s')
|
|
|
|
+ commit_content = Repo(local_path).git.diff(f"{repo_commit_hash}^", repo_commit_hash)
|
|
background_tasks.add_task(commit_task,commit_content,repo_id)
|
|
background_tasks.add_task(commit_task,commit_content,repo_id)
|
|
return {"code": 200, "msg": "添加提交任务成功"}
|
|
return {"code": 200, "msg": "添加提交任务成功"}
|
|
|
|
|