Skip to content

Commit

Permalink
Set safe.directory='*' on git call (#6015)
Browse files Browse the repository at this point in the history
This avoids the error:

```
fatal: detected dubious ownership in repository at '/tmp/workspace/gopath/src/golang.org/x/tools'
To add an exception for this directory, call:

	git config --global --add safe.directory /tmp/workspace/gopath/src/golang.org/x/tools
```
  • Loading branch information
jingyuanliang committed Feb 12, 2024
1 parent c39ced1 commit 32e41f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kythe/go/extractors/cmd/gotool/analyze_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ fi
# cd into the top-level git directory of our package and query git for the
# commit timestamp.
pushd "$(go env GOPATH)/src/${PACKAGE}"
TIMESTAMP="$(git log --pretty='%ad' -n 1 HEAD)"
TIMESTAMP="$(git -c safe.directory='*' log --pretty='%ad' -n 1 HEAD)"
popd

# Record the timestamp of the git commit in a metadata kzip.
Expand Down

0 comments on commit 32e41f7

Please sign in to comment.