Subject: Re: [PATCH v8 6/7] update-ref and tag: add --create-reflog arg

From: Michael Haggerty <[email-masked]>
Date: Tue, 21 Jul 2015 06:46:04 -0700

On 07/09/2015 03:50 PM, David Turner wrote:
> Allow the creation of a ref (e.g. stash) with a reflog already in
> place. For most refs (e.g. those under refs/heads), this happens
> automatically, but for others, we need this option.
> 
> Currently, git does this by pre-creating the reflog, but alternate ref
> backends might store reflogs somewhere other than .git/logs.  Code
> that now directly manipulates .git/logs should instead use git
> plumbing commands.
> 
> I also added --create-reflog to git tag, just for completeness.
> 
> In a moment, we will use this argument to make git stash work with
> alternate ref backends.
> 
> Signed-off-by: David Turner <[email-masked]>
> ---
>  Documentation/git-tag.txt        |  5 ++++-
>  Documentation/git-update-ref.txt |  5 ++++-
>  builtin/tag.c                    |  5 ++++-
>  builtin/update-ref.c             | 14 +++++++++++---
>  t/t1400-update-ref.sh            | 38 ++++++++++++++++++++++++++++++++++++++
>  t/t7004-tag.sh                   | 14 +++++++++++++-
>  6 files changed, 74 insertions(+), 7 deletions(-)
> 
> [...]
> diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
> index d1ff5c9..75423ab 100755
> --- a/t/t7004-tag.sh
> +++ b/t/t7004-tag.sh
> @@ -51,7 +51,19 @@ test_expect_success 'creating a tag using default HEAD should succeed' '
>  	echo foo >foo &&
>  	git add foo &&
>  	git commit -m Foo &&
> -	git tag mytag
> +	git tag mytag &&
> +	test_must_fail git reflog exists refs/tags/mytag
> +'
> +
> +test_expect_success 'creating a tag with --create-reflog should create reflog' '
> +	test_when_finished "git tag -d tag_with_reflog" &&
> +	git tag --create-reflog tag_with_reflog &&
> +	git reflog exists refs/tags/tag_with_reflog
> +'
> +
> +test_expect_success '--create-reflog does not creates reflog on failure' '

s/creates/create/

> +	test_must_fail git tag --create-reflog mytag &&
> +	test_must_fail git reflog exists refs/tags/tag_with_reflog

Shouldn't this be

	test_must_fail git reflog exists refs/tags/mytag

?

> [...]

Michael

-- 
Michael Haggerty
[email-masked]