Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-exz committed Dec 4, 2024
1 parent ffaa6fa commit b5abafa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Changelog
## 0.13.1
- Fixes in sync git repos

## 0.13.0
### Improvements
- Better logging of sync git repos
Expand Down
6 changes: 3 additions & 3 deletions lib/tasks/bitbucket.rake
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ namespace :bitbucket do

branches = bitbucket.branches(project['key'], repository['slug'])

# Get all existing commit IDs from the database
existing_commit_ids = BitbucketCommit.where(project_key: project['key'], repo_slug: repository['slug']).pluck(:commit_id)

branches.each do |branch|
print "Discovery all commits #{project['key']}:#{repository['slug']}:#{branch['id']}\n"
commits = bitbucket.commits(project['key'], repository['slug'], branch['id'])

print "Discovered #{commits.count} commits, trying to save.\n"

# Get all existing commit IDs from the database
existing_commit_ids = BitbucketCommit.where(project_key: project['key'], repo_slug: repository['slug']).pluck(:commit_id)

# Filter out commits that already exist in the database
new_commits = commits.reject { |commit| existing_commit_ids.include?(commit['id']) }

Expand Down

0 comments on commit b5abafa

Please sign in to comment.