t990X: use '.git/objects' as 'deep inside .git' path
authorChristian Couder <christian.couder@gmail.com>
Sat, 26 May 2018 06:47:45 +0000 (08:47 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 30 May 2018 03:55:53 +0000 (12:55 +0900)
Tests t9902-completion.sh and t9903-bash-prompt.sh each have tests
that check what happens when we are "in the '.git' directory" and
when we are "deep inside the '.git' directory".

To test the case when we are "deep inside the '.git' directory" the
test scripts used to perform a `cd .git/refs/heads`.

As there are plans to implement other ref storage systems, let's
use '.git/objects' instead of '.git/refs/heads' as the "deep inside
the '.git' directory" path.

This makes it 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.

Helped-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t9902-completion.sh
t/t9903-bash-prompt.sh
index b7f5b1e632fb27a0448239361d6b4207be4b9908..e7989d7796d6f66e0ec09c7ff0014a918de58095 100755 (executable)
@@ -179,7 +179,7 @@ test_expect_success '__git_find_repo_path - cwd is a .git directory' '
 test_expect_success '__git_find_repo_path - parent is a .git directory' '
        echo "$ROOT/.git" >expected &&
        (
-               cd .git/refs/heads &&
+               cd .git/objects &&
                __git_find_repo_path &&
                echo "$__git_repo_path" >"$actual"
        ) &&
index 8f5c811dd7d627ea5a0611be5161cea98deedb95..c3b89ae783d0b5511718be6d6b9d9978dd9131cd 100755 (executable)
@@ -148,7 +148,7 @@ test_expect_success 'prompt - inside .git directory' '
 test_expect_success 'prompt - deep inside .git directory' '
        printf " (GIT_DIR!)" >expected &&
        (
-               cd .git/refs/heads &&
+               cd .git/objects &&
                __git_ps1 >"$actual"
        ) &&
        test_cmp expected "$actual"