git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Torsten Bögershausen" <tboegi@web.de>
To: Stefan Beller <sbeller@google.com>,
	mhagger@alum.mit.edu, gitster@pobox.com, git@vger.kernel.org
Cc: Ronnie Sahlberg <sahlberg@google.com>
Subject: Re: [PATCH] t1402: check to delete broken refs
Date: Wed, 26 Nov 2014 06:05:00 +0100	[thread overview]
Message-ID: <54755F7C.3010803@web.de> (raw)
In-Reply-To: <1416956166-20341-1-git-send-email-sbeller@google.com>

On 11/25/2014 11:56 PM, Stefan Beller wrote:
> From: Ronnie Sahlberg <sahlberg@google.com>
>
> Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---
>   
>   This was also part of the ongoing series from Ronnie.
>   But I think the patch in this form is rather independant,
>   documenting the current state of "git branch -d", so it's
>   fine to have it in now.
>
>   t/t1402-check-ref-format.sh | 8 ++++++++
>   1 file changed, 8 insertions(+)
>
> diff --git a/t/t1402-check-ref-format.sh b/t/t1402-check-ref-format.sh
> index e5dc62e..08af156 100755
> --- a/t/t1402-check-ref-format.sh
> +++ b/t/t1402-check-ref-format.sh
> @@ -197,4 +197,12 @@ invalid_ref_normalized 'heads///foo.lock'
>   invalid_ref_normalized 'foo.lock/bar'
>   invalid_ref_normalized 'foo.lock///bar'
>   
> +test_expect_failure 'git branch -d can delete ref with broken sha1' '
> +	echo "pointing nowhere" > .git/refs/heads/brokensha1 &&
> +	test_when_finished "rm -f .git/refs/heads/brokensha1" &&
> +	git branch -d brokensha1 &&
> +	git branch >output &&
> +	! grep -e "brokensha1" output
> +'
Do we need grep -e here ?
It does not give us anything in the pattern we are using.

   -e PATTERN, --regexp=PATTERN
               Use  PATTERN  as  the pattern.  This can be used to 
specify multiple search patterns, or to protect a pattern beginning
               with a hyphen (-).  (-e is specified by POSIX.)

(And we do not need the "" either, there is no space in brokensha1)
We can simply use:
! grep brokensha1 output





> +
>   test_done

  parent reply	other threads:[~2014-11-26  5:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-25 22:56 [PATCH] t1402: check to delete broken refs Stefan Beller
2014-11-26  0:35 ` Jonathan Nieder
2014-11-26  0:42   ` Stefan Beller
2014-11-26  0:59     ` [PATCHv2] branch -d: test if we can " Stefan Beller
2014-11-26  8:49       ` Michael Haggerty
2014-11-26 18:43         ` Junio C Hamano
2014-11-26  5:05 ` Torsten Bögershausen [this message]
2014-11-26 18:37   ` [PATCHv3] " Stefan Beller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54755F7C.3010803@web.de \
    --to=tboegi@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=mhagger@alum.mit.edu \
    --cc=sahlberg@google.com \
    --cc=sbeller@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).