use the POSIX-compliant "date -u" command to return UTC time; ok stsp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
diff --git a/regress/cmdline/commit.sh b/regress/cmdline/commit.sh
index 4ea275e..cfed572 100755
--- a/regress/cmdline/commit.sh
+++ b/regress/cmdline/commit.sh
@@ -1399,7 +1399,7 @@ EOF
fi
local author_time=`git_show_author_time $testroot/repo`
- d=`env TZ=UTC date -r $author_time +"%a %b %e %X %Y UTC"`
+ d=`date -u -r $author_time +"%a %b %e %X %Y UTC"`
echo "-----------------------------------------------" > $testroot/stdout.expected
echo "commit $head_rev (master)" >> $testroot/stdout.expected
echo "from: $GOT_AUTHOR" >> $testroot/stdout.expected
@@ -1438,7 +1438,7 @@ EOF
fi
local author_time=`git_show_author_time $testroot/repo`
- d=`env TZ=UTC date -r $author_time +"%a %b %e %X %Y UTC"`
+ d=`date -u -r $author_time +"%a %b %e %X %Y UTC"`
echo "-----------------------------------------------" \
> $testroot/stdout.expected
echo "commit $head_rev (master)" >> $testroot/stdout.expected
diff --git a/regress/cmdline/histedit.sh b/regress/cmdline/histedit.sh
index 7de2767..94c4666 100755
--- a/regress/cmdline/histedit.sh
+++ b/regress/cmdline/histedit.sh
@@ -152,9 +152,9 @@ test_histedit_no_op() {
# We should have a backup of old commits
(cd $testroot/repo && got histedit -l > $testroot/stdout)
- d_orig2=`env TZ=UTC date -r $old_author_time2 +"%a %b %e %X %Y UTC"`
- d_new2=`env TZ=UTC date -r $new_author_time2 +"%G-%m-%d"`
- d_orig=`env TZ=UTC date -r $orig_author_time +"%G-%m-%d"`
+ d_orig2=`date -u -r $old_author_time2 +"%a %b %e %X %Y UTC"`
+ d_new2=`date -u -r $new_author_time2 +"%G-%m-%d"`
+ d_orig=`date -u -r $orig_author_time +"%G-%m-%d"`
cat > $testroot/stdout.expected <<EOF
-----------------------------------------------
commit $old_commit2 (formerly master)
diff --git a/regress/cmdline/rebase.sh b/regress/cmdline/rebase.sh
index adcd68a..a3608c6 100755
--- a/regress/cmdline/rebase.sh
+++ b/regress/cmdline/rebase.sh
@@ -153,9 +153,9 @@ test_rebase_basic() {
# We should have a backup of old commits
(cd $testroot/repo && got rebase -l > $testroot/stdout)
- d_orig2=`env TZ=UTC date -r $orig_author_time2 +"%a %b %e %X %Y UTC"`
- d_new2=`env TZ=UTC date -r $new_author_time2 +"%G-%m-%d"`
- d_0=`env TZ=UTC date -r $commit0_author_time +"%G-%m-%d"`
+ d_orig2=`date -u -r $orig_author_time2 +"%a %b %e %X %Y UTC"`
+ d_new2=`date -u -r $new_author_time2 +"%G-%m-%d"`
+ d_0=`date -u -r $commit0_author_time +"%G-%m-%d"`
cat > $testroot/stdout.expected <<EOF
-----------------------------------------------
commit $orig_commit2 (formerly newbranch)
diff --git a/regress/cmdline/tag.sh b/regress/cmdline/tag.sh
index 8710f96..fdc7ff8 100755
--- a/regress/cmdline/tag.sh
+++ b/regress/cmdline/tag.sh
@@ -137,11 +137,11 @@ test_tag_list() {
tag_id=`got ref -r $testroot/repo -l \
| grep "^refs/tags/$tag" | tr -d ' ' | cut -d: -f2`
local tagger_time=`git_show_tagger_time $testroot/repo $tag`
- d1=`env TZ=UTC date -r $tagger_time +"%a %b %e %X %Y UTC"`
+ d1=`date -u -r $tagger_time +"%a %b %e %X %Y UTC"`
tag_id2=`got ref -r $testroot/repo -l \
| grep "^refs/tags/$tag2" | tr -d ' ' | cut -d: -f2`
local tagger_time2=`git_show_tagger_time $testroot/repo $tag2`
- d2=`env TZ=UTC date -r $tagger_time2 +"%a %b %e %X %Y UTC"`
+ d2=`date -u -r $tagger_time2 +"%a %b %e %X %Y UTC"`
got tag -r $testroot/repo -l > $testroot/stdout
@@ -184,11 +184,11 @@ test_tag_list_lightweight() {
tag_id=`got ref -r $testroot/repo -l \
| grep "^refs/tags/$tag" | tr -d ' ' | cut -d: -f2`
local tagger_time=`git_show_author_time $testroot/repo $tag`
- d1=`env TZ=UTC date -r $tagger_time +"%a %b %e %X %Y UTC"`
+ d1=`date -u -r $tagger_time +"%a %b %e %X %Y UTC"`
tag_id2=`got ref -r $testroot/repo -l \
| grep "^refs/tags/$tag2" | tr -d ' ' | cut -d: -f2`
local tagger_time2=`git_show_author_time $testroot/repo $tag2`
- d2=`env TZ=UTC date -r $tagger_time2 +"%a %b %e %X %Y UTC"`
+ d2=`date -u -r $tagger_time2 +"%a %b %e %X %Y UTC"`
got tag -r $testroot/repo -l > $testroot/stdout