41ed9c27daa1b4e18c9447aa3fa26dd719da231f blob 1276 bytes (raw)
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
| | #!/bin/sh
test_description='git-commit can override local timezone setting by reading user.hideTimezone from config'
. ./test-lib.sh
test_expect_success 'commit date shows timezone offset +0300 when user.hideTimezone is false' '
git config user.hideTimezone false &&
echo test1 >> file &&
git add file &&
# unset GIT_AUTHOR_DATE from test_tick
unset GIT_AUTHOR_DATE &&
TZ=Europe/Istanbul git commit -m initial &&
git log -1 > output &&
grep "Date: .* +0300" output
'
test_expect_success 'commit date shows timezone offset +0000 when user.hideTimezone is true and reset' '
git config user.hideTimezone true &&
git commit --amend --reset-author &&
git log -1 > output &&
grep "Date: .* +0000" output
'
test_expect_success 'commit date shows timezone offset +0000 even TZ setting says otherwise' '
git config user.hideTimezone true &&
echo test2 >> file &&
git add file &&
# TZ setting corresponding to -0600 or -0500 depending on DST
# unset GIT_AUTHOR_DATE from test_tick
unset GIT_AUTHOR_DATE &&
TZ=America/Chicago git commit -m test2 &&
git log -1 > output &&
grep "Date: .* +0000" output
'
test_done
|
debug log:
solving 41ed9c27da ...
found 41ed9c27da in https://public-inbox.org/git/20200930232138.3656304-2-shengfa@google.com/
applying [1/1] https://public-inbox.org/git/20200930232138.3656304-2-shengfa@google.com/
diff --git a/t/t7527-commit-hide-timezone.sh b/t/t7527-commit-hide-timezone.sh
new file mode 100755
index 0000000000..41ed9c27da
Checking patch t/t7527-commit-hide-timezone.sh...
Applied patch t/t7527-commit-hide-timezone.sh cleanly.
index at:
100755 41ed9c27daa1b4e18c9447aa3fa26dd719da231f t/t7527-commit-hide-timezone.sh
Code repositories for project(s) associated with this inbox:
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).