Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix configure script to fail and report git error accordingly
Since git v2.30.3, git added a top-level directory ownership check (please see git/git@8959555ce). If the owner of the top-level directory does not match the current user, all git commands failed with message "fatal: detected dubious ownership in repository at _PATH_". However, our configure script does not properly report the error nor give a recommended action. The configure script silently moving on with 'NO_GIT_SHA' value. This patch modify the configure script to check the git command if we are in a git repository. If the git command resulted in an error, the configure script report the error messages from the git command and exited with a failure status. Please note that if the source tree is not in a git repository (no .git directory), the configure scirpt will skip git command checking. Example error output with recommended action from the git command: ```sh configure: '.git' directory presented. Checking git ... fatal: detected dubious ownership in repository at '/home/narate/projects/ovis' To add an exception for this directory, call: git config --global --add safe.directory /home/narate/projects/ovis configure: error: git command error make: *** [Makefile:636: config.status] Error 1 ``` Example of a good output: ```sh configure: '.git' directory presented. Checking git ... __GIT_DIR_PATH__ OK ```
- Loading branch information