This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git


The following commit(s) were added to refs/heads/main by this push:
     new 194d89728e4 Enhancement: use `-e` in getversion to check Git repo
194d89728e4 is described below

commit 194d89728e4769fc62059cc7cc6682a550f1ff17
Author: smartyhero <[email protected]>
AuthorDate: Mon Aug 18 10:38:16 2025 +0800

    Enhancement: use `-e` in getversion to check Git repo
    
    This commit replaces the use of the -d parameter with the -e parameter
    when checking for the presence of a Git repository. This allows for more
    comprehensive checks, including cases where the working directory may be
    part of a Git repository but not the entire repository.
---
 getversion | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/getversion b/getversion
index 76f6984ada5..b4c29112651 100755
--- a/getversion
+++ b/getversion
@@ -94,7 +94,7 @@ generate_dev_version() {
 }
 
 # Check if we're in a Git repo and git is available
-if type git >/dev/null 2>&1 && [ -d '.git' ]; then
+if type git >/dev/null 2>&1 && [ -e '.git' ]; then
     # Ensure git describe doesn't fail due to shallow clone
     if git describe --tags --long >/dev/null 2>&1; then
         if git describe --exact-match >/dev/null 2>&1; then


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to