Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Added logic to Ensure the repo is marked as safe for git (prevents SH... #107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
dacoburn merged 2 commits into main from doug/fix-git-safe-directory
Jul 29, 2025

Conversation

@dacoburn
Copy link
Collaborator

@dacoburn dacoburn commented Jul 29, 2025

The bug caused GitPython to fail in CI environments due to "dubious ownership" errors when the repository directory was not marked as safe in git config. This resulted in broken pipe and SHA empty errors during CLI execution.

Root Cause

GitPython requires the repository directory to be listed in git's global safe.directory config when running in some CI containers. If not, operations like commit lookup fail with errors. Previously, the code did not check or set this config, leading to failures in certain environments.

Fix

Added a helper function to check if the repository directory is already marked as safe in git config. If not, the function adds it before initializing the Repo object. This prevents the SHA empty/dubious ownership errors and ensures reliable operation in CI and local environments.

Public Changelog

N/A

@dacoburn dacoburn requested a review from a team as a code owner July 29, 2025 15:36
@dacoburn dacoburn requested review from jfblaa and nolanlawson and removed request for a team July 29, 2025 15:36
Copy link

github-actions bot commented Jul 29, 2025
edited
Loading

🚀 Preview package published!

Install with:

pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple socketsecurity==2.1.35.dev1

Docker image: socketdev/cli:pr-107

Copy link

@jonathanStrange0 jonathanStrange0 left a comment

Choose a reason for hiding this comment

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

lgtm. Let's try it

@dacoburn dacoburn merged commit 095b0cc into main Jul 29, 2025
6 checks passed
@dacoburn dacoburn deleted the doug/fix-git-safe-directory branch July 29, 2025 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jonathanStrange0 jonathanStrange0 jonathanStrange0 approved these changes

@nolanlawson nolanlawson Awaiting requested review from nolanlawson nolanlawson is a code owner automatically assigned from SocketDev/eng

@jfblaa jfblaa Awaiting requested review from jfblaa jfblaa is a code owner automatically assigned from SocketDev/eng

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /