fix: log source branch file count #33

Open
dtwdtw wants to merge 1 commits from dtwdtw/reposync:fix/issue-116590-log-repo-file-count into master
1 changed files with 3 additions and 0 deletions

View File

@ -261,6 +261,9 @@ async def sync_oneway_inter_code(project: ProjectDTO, job: JobDTO):
repo_dir = dir + "/" + project.name
await cmd.shell('git status', repo_dir, job)
tracked_files, err = await cmd.shell('git ls-files', repo_dir, job)
tracked_files = [item for item in str.splitlines(tracked_files) if item]
await Log(LogType.INFO, f"The source branch {job.gitlab_branch} has {len(tracked_files)} tracked files", job.id)
await cmd.shell(
f"git remote add github {project.github_address}", repo_dir, job)
await cmd.shell('git fetch github', repo_dir, job)