Skip to content

Use git source rules for validating gitdir: paths - #6

Merged
sebastianfeldmann merged 1 commit into
captainhook-git:mainfrom
shadowhand:align-dot-git-path-reads
Aug 10, 2026
Merged

Use git source rules for validating gitdir: paths#6
sebastianfeldmann merged 1 commit into
captainhook-git:mainfrom
shadowhand:align-dot-git-path-reads

Conversation

@shadowhand

Copy link
Copy Markdown
Contributor

Comment thread .gitignore
Comment on lines -1 to +6
/vendor/
/build/
/tools/
/composer.lock
/vendor/
/.cs-check.json
/build
/.phpunit.result.cache
/composer.lock

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

  • Applied alphabetical sorting (directories first)
  • Added .phpunit.result.cache entry

Comment thread src/DotGit.php
Comment on lines +67 to +70
if (!str_starts_with($dotGitContent, 'gitdir: ')) {
throw new RuntimeException('invalid .git file');
}
$dir = rtrim(substr($dotGitContent, 8), "\r\n");

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@sebastianfeldmann sebastianfeldmann left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice!

@sebastianfeldmann

Copy link
Copy Markdown
Contributor

Thanks again ;)

@sebastianfeldmann
sebastianfeldmann merged commit 39db83f into captainhook-git:main Aug 10, 2026
6 checks passed
@shadowhand
shadowhand deleted the align-dot-git-path-reads branch August 10, 2026 13:33
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.

2 participants