git.patch 588 B

12345678910111213141516171819202122232425
  1. From c7518550fc8b0e62f1c7ea96495eec621bc395ef Mon Sep 17 00:00:00 2001
  2. From: orbea <orbea@fredslev.dk>
  3. Date: Sun, 9 Dec 2018 13:42:49 -0800
  4. Subject: [PATCH] getver.sh: Only use git if its a git repo.
  5. ---
  6. getver.sh | 4 +++-
  7. 1 file changed, 3 insertions(+), 1 deletion(-)
  8. diff --git a/getver.sh b/getver.sh
  9. index 7bb1889..45261dd 100755
  10. --- a/getver.sh
  11. +++ b/getver.sh
  12. @@ -2,7 +2,9 @@
  13. ver=unknown
  14. -[ -n "`which git`" ] && ver=`git describe`
  15. +if [ -n "`which git`" ] && git rev-parse HEAD 2>/dev/null; then
  16. + ver=`git describe`
  17. +fi
  18. cat > include/version.h << EOF
  19. #ifndef VER_H