git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Beller <sbeller@google.com>
To: mhagger@alum.mit.edu, gitster@pobox.com, tboegi@web.de,
	jrnieder@gmail.com, ronniesahlberg@gmail.com,
	git@vger.kernel.org
Cc: Ronnie Sahlberg <sahlberg@google.com>,
	Stefan Beller <sbeller@google.com>
Subject: [PATCHv3] branch -d: test if we can delete broken refs
Date: Wed, 26 Nov 2014 10:37:04 -0800	[thread overview]
Message-ID: <1417027024-17054-1-git-send-email-sbeller@google.com> (raw)
In-Reply-To: <54755F7C.3010803@web.de>

From: Ronnie Sahlberg <sahlberg@google.com>

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
---
Changes v1->v2
 * relocated the test from t1402 to t3200
 * reword the commit message title to fit in with similar commits touching 
   t/t3200-branch.sh 

Changes v2 -> v3
 * remove space nit pointed out by Michael
 * simplified grep expression as pointed out by Torsten
 
 I don't mind applying this one later as part of the series, where we actually
 introduce the feature. Thanks for all the feedback! 

Michael writes 
> On the other hand, this is kind of an "aspirational test"; I don't
> know that the tested functionality has ever worked or that anybody has
> ever claimed that it works. So my feeling is that the addition of the
> test would feel more natural in the patch series that implements the new
> feature. But I don't feel strongly about it.

 I don't have a strong oppinion on this one either. It's just my impression, that
 small single patches are digested easier by the mailing list rather than large series.
 So as the feedback is in, I'll put this patch at the end of the series, where the actual
 feature will be introduced.
 

 t/t3200-branch.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index 432921b..fa7d7bd 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -163,6 +163,14 @@ test_expect_success 'git branch --list -d t should fail' '
 	test_path_is_missing .git/refs/heads/t
 '
 
+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 brokensha1 output
+'
+
 test_expect_success 'git branch --column' '
 	COLUMNS=81 git branch --column=column >actual &&
 	cat >expected <<\EOF &&
-- 
2.2.0.rc3

      reply	other threads:[~2014-11-26 18:37 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 ` [PATCH] t1402: check to " Torsten Bögershausen
2014-11-26 18:37   ` Stefan Beller [this message]

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=1417027024-17054-1-git-send-email-sbeller@google.com \
    --to=sbeller@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=mhagger@alum.mit.edu \
    --cc=ronniesahlberg@gmail.com \
    --cc=sahlberg@google.com \
    --cc=tboegi@web.de \
    /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).