[beast] mkrelease.sh: fixed 'commit-stamps' outside of git repos



commit d44664c0a26950f467719642f0f47315ceb9c441
Author: Tim Janik <timj gtk org>
Date:   Fri Sep 10 18:56:41 2010 +0200

    mkrelease.sh: fixed 'commit-stamps' outside of git repos

 mkrelease.sh |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/mkrelease.sh b/mkrelease.sh
index 9678107..82dcfef 100755
--- a/mkrelease.sh
+++ b/mkrelease.sh
@@ -4,6 +4,7 @@
 ## This work is provided "as is"; see: http://rapicorn.org/LICENSE-AS-IS
 
 MYVERSION="mkrelease.sh version 20100901"
+# 20100910: fixed 'commit-stamps' outside of git repos
 # 20100901: check HEAD against upstream repository, upload last
 # 20100831: implemented 'shellvar' command
 # 20100827: implemented 'news' command
@@ -82,10 +83,11 @@ done
 # === commit-stamps ===
 [ "$COMMAND" = "commit-stamps" ] && {
   # echo stamp files touched by commits
-  ls "${GIT_DIR:-.git}/`git symbolic-ref -q HEAD || echo HEAD`" \
-     "${GIT_DIR:-.git}/packed-refs" \
-     "${GIT_DIR:-.git}/HEAD" \
-     2>/dev/null
+  [ -e "${GIT_DIR:-.git}" ] && \
+    ls "${GIT_DIR:-.git}/`git symbolic-ref -q HEAD || echo HEAD`" \
+       "${GIT_DIR:-.git}/packed-refs" \
+       "${GIT_DIR:-.git}/HEAD" \
+       2>/dev/null
   exit
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]