Author: acinonyx Date: 2016-04-13 22:52:26 +0200 (Wed, 13 Apr 2016) New Revision: 49165
Modified: trunk/scripts/getver.sh Log: scripts/getver.sh: Use 'git-rev-parse' to detect if tree lies in Git repository Path to the Git repository directory can be overriden by using the '$GIT_DIR' environment variable. This patch improves detection of Git repository by using 'git-rev-parse', which respects '$GIT_DIR' environment variable, instead of just checking the existence of '.git' directory. Signed-off-by: Vasilis Tsiligiannis <[email protected]> Modified: trunk/scripts/getver.sh =================================================================== --- trunk/scripts/getver.sh 2016-04-13 20:21:38 UTC (rev 49164) +++ trunk/scripts/getver.sh 2016-04-13 20:52:26 UTC (rev 49165) @@ -17,7 +17,7 @@ } try_git() { - [ -e .git ] || return 1 + git rev-parse --git-dir >/dev/null 2>&1 || return 1 REV="$(git log | grep -m 1 git-svn-id | awk '{ gsub(/.*@/, "", $0); print $1 }')" REV="${REV:+r$REV}" [ -n "$REV" ] _______________________________________________ openwrt-commits mailing list [email protected] https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits
