Skip to content

Commit

Permalink
Check if .git exists as a file as well (#96)
Browse files Browse the repository at this point in the history
If the directory you are working from is a git worktree, `.git` [is not
a directory but a
file](https://git-scm.com/docs/git-worktree#_details)(last sentence of
the second paragraph).

This fixes getting `skipping make checknodiffgenerated due to no .git
repository` when running make from a git worktree.
  • Loading branch information
oliversun9 authored Jul 18, 2023
1 parent caeb89a commit f3bb724
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion make/go/base.mk
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ generate: ## Run all generation steps.

.PHONY: checknodiffgenerated
checknodiffgenerated:
@ if [ -d .git ]; then \
@ if [[ -d .git || -f .git ]]; then \
$(MAKE) __checknodiffgeneratedinternal; \
else \
echo "skipping make checknodiffgenerated due to no .git repository" >&2; \
Expand Down

0 comments on commit f3bb724

Please sign in to comment.