Repository navigation
Accept repositories where .git is a file - #417
Merged
Merged
Conversation
The repository check used `[ -d ".git" ]`, which fails for git submodules, linked worktrees and clones made with `--separate-git-dir`. In those cases `.git` is a file that points to the actual git directory. Use `-e` instead so both forms are accepted. Also escape the backticks around `repository` in the error message. Unescaped, bash ran `repository` as a command substitution and the input name was missing from the message. Add tests for submodules (absolute and relative path), `--separate-git-dir`, linked worktrees, the error message and a non-existing repository directory. Fixes #416
1 task
samip5
pushed a commit
to k8s-gateway/k8s_gateway
that referenced
this pull request
Oct 28, 2026
…action action to v7.2.1 (#400) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [https://github.com/stefanzweifel/git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action) | action | patch | `v7.2.0` → `v7.2.1` | --- ### Release Notes <details> <summary>stefanzweifel/git-auto-commit-action (https://github.com/stefanzweifel/git-auto-commit-action)</summary> ### [`v7.2.1`](https://github.com/stefanzweifel/git-auto-commit-action/blob/HEAD/CHANGELOG.md#v721---2026-10-22) [Compare Source](stefanzweifel/git-auto-commit-action@v7.2.0...v7.2.1) ##### Fixed - Accept repositories where .git is a file ([#​417](stefanzweifel/git-auto-commit-action#417)) [@​stefanzweifel](https://github.com/@stefanzweifel) - README: Update actions ([#​413](stefanzweifel/git-auto-commit-action#413)) [@​jackbayliss](https://github.com/@jackbayliss) - Remove unused gitStatusMessage variable in the entrypoint ([#​415](stefanzweifel/git-auto-commit-action#415)) [@​ChihweiLHBird](https://github.com/@ChihweiLHBird) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC42NS41IiwidXBkYXRlZEluVmVyIjoiNDQuNjUuNSIsInRhcmdldEJyYW5jaCI6Im1hc3RlciIsImxhYmVscyI6W119--> Reviewed-on: https://codeberg.org/k8s-gateway/k8s_gateway/pulls/400
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #416
Problem
The repository check used
[ -d ".git" ]. In git submodules, linked worktrees and clones made with--separate-git-dir,.gitis a file that points to the real git directory. The check failed for these and the action exited with "Not a git repository".Changes
[ -e ".git" ]so both a.gitdirectory and a.gitfile are accepted.repositoryin the error message. Unescaped, bash ranrepositoryas a command substitution (repository: command not found) and the input name was missing from the message.Tests
New BATS tests cover:
repositorypath--separate-git-dirgit worktreecommand not foundrepositorydirectoryThe submodule, separate-git-dir and error message tests fail without the
entrypoint.shchange.