Skip to content

Support force-with-lease pushes - #26

Merged
odrobnik merged 3 commits into
mainfrom
agent/issue-22
Jul 11, 2026
Merged

Support force-with-lease pushes#26
odrobnik merged 3 commits into
mainfrom
agent/issue-22

Conversation

@odrobnik

Copy link
Copy Markdown
Contributor

Resolves #22.

Summary

  • Add PushLease and a Repository.push(... forceWithLease:) overload for tracking-based and explicit-OID lease checks.
  • Enforce the lease in libgit2's push negotiation callback on the actual push connection, then send the update as a force refspec only when the lease matches.
  • Add an integration test that verifies a stale lease refuses to overwrite an advanced remote branch and a fresh expected OID succeeds.

Verification

  • swift build --build-tests --scratch-path /Volumes/SSD/SwiftPM/GitKit-issue-22
  • swift test --skip-build --scratch-path /Volumes/SSD/SwiftPM/GitKit-issue-22

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1508215eb9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/GitKit/CallbacksPayload.swift
@odrobnik
odrobnik merged commit a67d9f4 into main Jul 11, 2026
6 checks passed
@odrobnik
odrobnik deleted the agent/issue-22 branch July 11, 2026 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support push --force-with-lease semantics

1 participant