diff mbox series

[v19,02/20] t3432: use git-reflog to inspect the reflog for HEAD

Message ID 277da0cf7ed641a085e6f4d843aa5ac0dd56a6c4.1593457018.git.gitgitgadget@gmail.com (mailing list archive)
State New, archived
Headers show
Series Reftable support git-core | expand

Commit Message

Johannes Schindelin via GitGitGadget June 29, 2020, 6:56 p.m. UTC
From: Han-Wen Nienhuys <hanwen@google.com>

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t3432-rebase-fast-forward.sh | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Denton Liu June 30, 2020, 3:23 p.m. UTC | #1
Hi Han-Wen,

On Mon, Jun 29, 2020 at 06:56:40PM +0000, Han-Wen Nienhuys via GitGitGadget wrote:
> From: Han-Wen Nienhuys <hanwen@google.com>
> 
> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
> ---
>  t/t3432-rebase-fast-forward.sh | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/t/t3432-rebase-fast-forward.sh b/t/t3432-rebase-fast-forward.sh
> index 6f0452c0ea..22afeb8ccd 100755
> --- a/t/t3432-rebase-fast-forward.sh
> +++ b/t/t3432-rebase-fast-forward.sh
> @@ -60,15 +60,16 @@ test_rebase_same_head_ () {
>  		fi &&
>  		oldhead=\$(git rev-parse HEAD) &&
>  		test_when_finished 'git reset --hard \$oldhead' &&
> -		cp .git/logs/HEAD expect &&
> +		git reflog HEAD > expect &&

Tiny nit: there should be no space present after the redirect operator,
so it should be written like this

	git reflog HEAD >expect

>  		git rebase$flag $* >stdout &&
> +		git reflog HEAD > actual &&

Same here.

>  		if test $what = work
>  		then
>  			old=\$(wc -l <expect) &&
> -			test_line_count '-gt' \$old .git/logs/HEAD
> +			test_line_count '-gt' \$old actual
>  		elif test $what = noop
>  		then
> -			test_cmp expect .git/logs/HEAD
> +			test_cmp expect actual
>  		fi &&
>  		newhead=\$(git rev-parse HEAD) &&
>  		if test $cmp = same
> -- 
> gitgitgadget
>
diff mbox series

Patch

diff --git a/t/t3432-rebase-fast-forward.sh b/t/t3432-rebase-fast-forward.sh
index 6f0452c0ea..22afeb8ccd 100755
--- a/t/t3432-rebase-fast-forward.sh
+++ b/t/t3432-rebase-fast-forward.sh
@@ -60,15 +60,16 @@  test_rebase_same_head_ () {
 		fi &&
 		oldhead=\$(git rev-parse HEAD) &&
 		test_when_finished 'git reset --hard \$oldhead' &&
-		cp .git/logs/HEAD expect &&
+		git reflog HEAD > expect &&
 		git rebase$flag $* >stdout &&
+		git reflog HEAD > actual &&
 		if test $what = work
 		then
 			old=\$(wc -l <expect) &&
-			test_line_count '-gt' \$old .git/logs/HEAD
+			test_line_count '-gt' \$old actual
 		elif test $what = noop
 		then
-			test_cmp expect .git/logs/HEAD
+			test_cmp expect actual
 		fi &&
 		newhead=\$(git rev-parse HEAD) &&
 		if test $cmp = same