summaryrefslogtreecommitdiff
path: root/t/t4208-log-magic-pathspec.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2021-02-09 10:52:45 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-02-09 21:36:06 (GMT)
commit3803a3a0993045605d7f3db363188ce377e917c8 (patch)
tree4b286c6f84cd701b5aaa3ad2956411764de5ae7f /t/t4208-log-magic-pathspec.sh
parent1d4f2316c5b767ccbf20cc3d55c98d1f92e6e1ce (diff)
downloadgit-3803a3a0993045605d7f3db363188ce377e917c8.zip
git-3803a3a0993045605d7f3db363188ce377e917c8.tar.gz
git-3803a3a0993045605d7f3db363188ce377e917c8.tar.bz2
t: add --no-tag option to test_commit
One of the conveniences that test_commit offers is making a tag for each commit. This makes it easy to refer to the commits in subsequent commands. But it can also be a pain if you care about reachability, because those tags keep the commits reachable even if they are rewound from the branch they're made on. The alternative is that scripts have to call test_tick, git-add, and git-commit themselves. Let's add a --no-tag option to give them the one-liner convenience of using test_commit. This is in preparation for the next patch, which will add some more calls. But I cleaned up an existing site to show off the feature. There are probably more cleanups possible. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4208-log-magic-pathspec.sh')
-rwxr-xr-xt/t4208-log-magic-pathspec.sh9
1 files changed, 2 insertions, 7 deletions
diff --git a/t/t4208-log-magic-pathspec.sh b/t/t4208-log-magic-pathspec.sh
index 5e10136..7f0c1dc 100755
--- a/t/t4208-log-magic-pathspec.sh
+++ b/t/t4208-log-magic-pathspec.sh
@@ -31,13 +31,8 @@ test_expect_success '"git log :/a -- " should not be ambiguous' '
test_expect_success '"git log :/detached -- " should find a commit only in HEAD' '
test_when_finished "git checkout main" &&
git checkout --detach &&
- # Must manually call `test_tick` instead of using `test_commit`,
- # because the latter additionally creates a tag, which would make
- # the commit reachable not only via HEAD.
- test_tick &&
- git commit --allow-empty -m detached &&
- test_tick &&
- git commit --allow-empty -m something-else &&
+ test_commit --no-tag detached &&
+ test_commit --no-tag something-else &&
git log :/detached --
'