Skip to content

Commit

Permalink
WIP: set GIT_REFLOG_DATE in test_tick
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipwood committed Dec 19, 2024
1 parent 591bd5a commit 58c3782
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
3 changes: 2 additions & 1 deletion refs/files-backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -1892,7 +1892,8 @@ static int files_log_ref_write(struct files_ref_store *refs,
result = log_ref_write_fd(logfd, old_oid, new_oid,
fmt_ident(getenv("GIT_COMMITTER_NAME"),
getenv("GIT_COMMITTER_EMAIL"),
WANT_COMMITTER_IDENT, NULL, 0),
WANT_COMMITTER_IDENT,
getenv("GIT_REFLOG_DATE"), 0),
msg);
if (result) {
struct strbuf sb = STRBUF_INIT;
Expand Down
11 changes: 9 additions & 2 deletions refs/reftable-backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -1413,7 +1413,11 @@ static int write_transaction_table(struct reftable_writer *writer, void *cb_data
const char *committer_info;
int ret = 0;

committer_info = git_committer_info(0);
committer_info = fmt_ident(getenv("GIT_COMMITTER_NAME"),
getenv("GIT_COMMITTER_EMAIL"),
WANT_COMMITTER_IDENT,
getenv("GIT_REFLOG_DATE"), 0),
git_committer_info(0);
if (split_ident_line(&committer_ident, committer_info, strlen(committer_info)))
BUG("failed splitting committer info");

Expand Down Expand Up @@ -1677,7 +1681,10 @@ static int write_copy_table(struct reftable_writer *writer, void *cb_data)
const char *committer_info;

Check failure on line 1681 in refs/reftable-backend.c

View workflow job for this annotation

GitHub Actions / linux-leaks (ubuntu-latest)

refs/reftable-backend.c:1681:21: variable ‘committer_info’ set but not used [-Werror=unused-but-set-variable]

Check failure on line 1681 in refs/reftable-backend.c

View workflow job for this annotation

GitHub Actions / linux-reftable-leaks (ubuntu-latest)

refs/reftable-backend.c:1681:21: variable ‘committer_info’ set but not used [-Werror=unused-but-set-variable]

Check failure on line 1681 in refs/reftable-backend.c

View workflow job for this annotation

GitHub Actions / linux-gcc-default (ubuntu-latest)

refs/reftable-backend.c:1681:21: variable ‘committer_info’ set but not used [-Werror=unused-but-set-variable]

Check failure on line 1681 in refs/reftable-backend.c

View workflow job for this annotation

GitHub Actions / almalinux-8 (almalinux:8)

refs/reftable-backend.c:1681:14: variable 'committer_info' set but not used [-Werror=unused-but-set-variable]

Check failure on line 1681 in refs/reftable-backend.c

View workflow job for this annotation

GitHub Actions / linux-gcc (ubuntu-20.04)

refs/reftable-backend.c:1681:14: variable ‘committer_info’ set but not used [-Werror=unused-but-set-variable]

Check failure on line 1681 in refs/reftable-backend.c

View workflow job for this annotation

GitHub Actions / linux-musl (alpine)

refs/reftable-backend.c:1681:21: variable 'committer_info' set but not used [-Werror=unused-but-set-variable]

Check failure on line 1681 in refs/reftable-backend.c

View workflow job for this annotation

GitHub Actions / linux-TEST-vars (ubuntu-20.04)

refs/reftable-backend.c:1681:14: variable ‘committer_info’ set but not used [-Werror=unused-but-set-variable]

Check failure on line 1681 in refs/reftable-backend.c

View workflow job for this annotation

GitHub Actions / debian-11 (debian:11)

refs/reftable-backend.c:1681:14: variable 'committer_info' set but not used [-Werror=unused-but-set-variable]

Check failure on line 1681 in refs/reftable-backend.c

View workflow job for this annotation

GitHub Actions / pedantic (fedora)

refs/reftable-backend.c:1681:21: variable 'committer_info' set but not used [-Werror=unused-but-set-variable]

Check failure on line 1681 in refs/reftable-backend.c

View workflow job for this annotation

GitHub Actions / linux32 (i386/ubuntu:focal)

refs/reftable-backend.c:1681:14: variable 'committer_info' set but not used [-Werror=unused-but-set-variable]

Check failure on line 1681 in refs/reftable-backend.c

View workflow job for this annotation

GitHub Actions / win build

refs/reftable-backend.c:1681:21: variable 'committer_info' set but not used [-Werror=unused-but-set-variable]
int ret;

committer_info = git_committer_info(0);
committer_info = fmt_ident(getenv("GIT_COMMITTER_NAME"),
getenv("GIT_COMMITTER_EMAIL"),
WANT_COMMITTER_IDENT,
getenv("GIT_REFLOG_DATE"), 0),

Check failure on line 1687 in refs/reftable-backend.c

View workflow job for this annotation

GitHub Actions / fuzz smoke test

refs/reftable-backend.c:1687:37: expected ';' after expression

Check failure on line 1687 in refs/reftable-backend.c

View workflow job for this annotation

GitHub Actions / linux-reftable (ubuntu-latest)

refs/reftable-backend.c:1687:37: expected ';' after expression

Check failure on line 1687 in refs/reftable-backend.c

View workflow job for this annotation

GitHub Actions / linux-sha256 (ubuntu-latest)

refs/reftable-backend.c:1687:37: expected ';' after expression

Check failure on line 1687 in refs/reftable-backend.c

View workflow job for this annotation

GitHub Actions / linux-asan-ubsan (ubuntu-latest)

refs/reftable-backend.c:1687:37: expected ';' after expression
if (split_ident_line(&committer_ident, committer_info, strlen(committer_info)))

Check failure on line 1688 in refs/reftable-backend.c

View workflow job for this annotation

GitHub Actions / linux-leaks (ubuntu-latest)

refs/reftable-backend.c:1688:9: expected expression before ‘if’

Check failure on line 1688 in refs/reftable-backend.c

View workflow job for this annotation

GitHub Actions / linux-reftable-leaks (ubuntu-latest)

refs/reftable-backend.c:1688:9: expected expression before ‘if’

Check failure on line 1688 in refs/reftable-backend.c

View workflow job for this annotation

GitHub Actions / linux-gcc-default (ubuntu-latest)

refs/reftable-backend.c:1688:9: expected expression before ‘if’

Check failure on line 1688 in refs/reftable-backend.c

View workflow job for this annotation

GitHub Actions / almalinux-8 (almalinux:8)

refs/reftable-backend.c:1688:2: expected expression before 'if'

Check failure on line 1688 in refs/reftable-backend.c

View workflow job for this annotation

GitHub Actions / linux-gcc (ubuntu-20.04)

refs/reftable-backend.c:1688:2: expected expression before ‘if’

Check failure on line 1688 in refs/reftable-backend.c

View workflow job for this annotation

GitHub Actions / linux-musl (alpine)

refs/reftable-backend.c:1688:9: expected expression before 'if'

Check failure on line 1688 in refs/reftable-backend.c

View workflow job for this annotation

GitHub Actions / linux-TEST-vars (ubuntu-20.04)

refs/reftable-backend.c:1688:2: expected expression before ‘if’

Check failure on line 1688 in refs/reftable-backend.c

View workflow job for this annotation

GitHub Actions / debian-11 (debian:11)

refs/reftable-backend.c:1688:2: expected expression before 'if'

Check failure on line 1688 in refs/reftable-backend.c

View workflow job for this annotation

GitHub Actions / pedantic (fedora)

refs/reftable-backend.c:1688:9: expected expression before 'if'

Check failure on line 1688 in refs/reftable-backend.c

View workflow job for this annotation

GitHub Actions / linux32 (i386/ubuntu:focal)

refs/reftable-backend.c:1688:2: expected expression before 'if'

Check failure on line 1688 in refs/reftable-backend.c

View workflow job for this annotation

GitHub Actions / win build

refs/reftable-backend.c:1688:9: expected expression before 'if'
BUG("failed splitting committer info");

Expand Down
12 changes: 5 additions & 7 deletions t/test-lib-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ test_tick () {
fi
GIT_COMMITTER_DATE="$test_tick -0700"
GIT_AUTHOR_DATE="$test_tick -0700"
export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
GIT_REFLOG_DATE="$test_tick -0700"
export GIT_COMMITTER_DATE GIT_AUTHOR_DATE GIT_REFLOG_DATE
}

# Stop execution and start a shell. This is useful for debugging tests.
Expand Down Expand Up @@ -397,24 +398,21 @@ test_commit () {
then
test_tick
fi &&
GIT_TEST_DATE_NOW=$test_tick TZ=PDT+7 \
git ${indir:+ -C "$indir"} commit \
git ${indir:+ -C "$indir"} commit \
${author:+ --author "$author"} \
$signoff -m "$1" &&
case "$tag" in
none)
;;
light)
GIT_TEST_DATE_NOW=$test_tick TZ=PDT+7 \
git ${indir:+ -C "$indir"} tag "${4:-$1}"
git ${indir:+ -C "$indir"} tag "${4:-$1}"
;;
annotate)
if test -z "$notick"
then
test_tick
fi &&
GIT_TEST_DATE_NOW=$test_tick TZ=PDT+7 \
git ${indir:+ -C "$indir"} tag -a -m "$1" "${4:-$1}"
git ${indir:+ -C "$indir"} tag -a -m "$1" "${4:-$1}"
;;
esac
}
Expand Down

0 comments on commit 58c3782

Please sign in to comment.