Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Turner <dturner@twopensource.com>2018-05-23 08:25:17 +0300
committerJunio C Hamano <gitster@pobox.com>2018-05-23 08:59:38 +0300
commitcbc5cf7ce5112a5c704ce4116b8414c8385d23ca (patch)
tree01ecfdcf4ae14e2a26e6c20f5de5621957447abe /t/lib-t6000.sh
parent468165c1d8a442994a825f3684528361727cd8c0 (diff)
t: make many tests depend less on the refs being files
Many tests are very focused on the file system representation of the loose and packed refs code. As there are plans to implement other ref storage systems, let's migrate these tests to a form that test the intent of the refs storage system instead of it internals. This will make clear to readers that these tests do not depend on which ref backend is used. The internals of the loose refs backend are still tested in t1400-update-ref.sh, whereas the tests changed in this patch focus on testing other aspects. This patch just takes care of many low hanging fruits. It does not try to completely solves the issue. Helped-by: Stefan Beller <sbeller@google.com> Helped-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: David Turner <dturner@twopensource.com> Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/lib-t6000.sh')
-rw-r--r--t/lib-t6000.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/t/lib-t6000.sh b/t/lib-t6000.sh
index 3f2d873fec..b0ed4767e3 100644
--- a/t/lib-t6000.sh
+++ b/t/lib-t6000.sh
@@ -4,11 +4,11 @@ mkdir -p .git/refs/tags
>sed.script
-# Answer the sha1 has associated with the tag. The tag must exist in .git/refs/tags
+# Answer the sha1 has associated with the tag. The tag must exist under refs/tags
tag () {
_tag=$1
- test -f ".git/refs/tags/$_tag" || error "tag: \"$_tag\" does not exist"
- cat ".git/refs/tags/$_tag"
+ git rev-parse --verify "refs/tags/$_tag" ||
+ error "tag: \"$_tag\" does not exist"
}
# Generate a commit using the text specified to make it unique and the tree