git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] t990X: use '.git/objects' as 'deep inside .git' path
@ 2018-05-26  6:47 Christian Couder
  2018-05-27  4:49 ` Michael Haggerty
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Couder @ 2018-05-26  6:47 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason,
	Stefan Beller, Jonathan Nieder, Jonathan Tan, Duy Nguyen,
	Derrick Stolee, Carlos Martín Nieto, Michael Haggerty,
	David Turner, Johannes Schindelin, SZEDER Gábor,
	Christian Couder, David Turner

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>
---
 t/t9902-completion.sh  | 2 +-
 t/t9903-bash-prompt.sh | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index 36deb0b123..a28640ce1a 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -181,7 +181,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"
 	) &&
diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh
index 8f5c811dd7..c3b89ae783 100755
--- a/t/t9903-bash-prompt.sh
+++ b/t/t9903-bash-prompt.sh
@@ -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"
-- 
2.17.0.1181.g093e983b05.dirty


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] t990X: use '.git/objects' as 'deep inside .git' path
  2018-05-26  6:47 [PATCH] t990X: use '.git/objects' as 'deep inside .git' path Christian Couder
@ 2018-05-27  4:49 ` Michael Haggerty
  2018-05-29 11:58   ` Derrick Stolee
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Haggerty @ 2018-05-27  4:49 UTC (permalink / raw)
  To: Christian Couder
  Cc: Git Mailing List, Junio C Hamano,
	Ævar Arnfjörð Bjarmason, Stefan Beller,
	Jonathan Nieder, Jonathan Tan, Duy Nguyen, Derrick Stolee,
	Carlos Martín Nieto, David Turner, Johannes Schindelin,
	SZEDER Gábor, Christian Couder, David Turner

On Sat, May 26, 2018 at 8:47 AM, Christian Couder
<christian.couder@gmail.com> wrote:
> 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.

Seems reasonable to me. +1.

Michael

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] t990X: use '.git/objects' as 'deep inside .git' path
  2018-05-27  4:49 ` Michael Haggerty
@ 2018-05-29 11:58   ` Derrick Stolee
  0 siblings, 0 replies; 3+ messages in thread
From: Derrick Stolee @ 2018-05-29 11:58 UTC (permalink / raw)
  To: mhagger, Christian Couder
  Cc: Git Mailing List, Junio C Hamano,
	Ævar Arnfjörð Bjarmason, Stefan Beller,
	Jonathan Nieder, Jonathan Tan, Duy Nguyen,
	Carlos Martín Nieto, David Turner, Johannes Schindelin,
	SZEDER Gábor, Christian Couder, David Turner

On 5/27/2018 12:49 AM, Michael Haggerty wrote:
> On Sat, May 26, 2018 at 8:47 AM, Christian Couder
> <christian.couder@gmail.com> wrote:
>> 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.
> Seems reasonable to me. +1.
>
> Michael
Looks good to me, too.

Thanks,
-Stolee

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-29 11:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-26  6:47 [PATCH] t990X: use '.git/objects' as 'deep inside .git' path Christian Couder
2018-05-27  4:49 ` Michael Haggerty
2018-05-29 11:58   ` Derrick Stolee

Code repositories for project(s) associated with this public 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).