From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Tan Subject: Re: [PATCH 02/12] t4150: am fails if index is dirty Date: Tue, 7 Jul 2015 14:35:59 +0800 Message-ID: References: <1435861000-25278-1-git-send-email-pyokagan@gmail.com> <1435861000-25278-3-git-send-email-pyokagan@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: Git List , Stefan Beller , Junio C Hamano To: Johannes Schindelin X-From: git-owner@vger.kernel.org Tue Jul 07 08:36:08 2015 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZCMUB-0007b3-4e for gcvg-git-2@plane.gmane.org; Tue, 07 Jul 2015 08:36:07 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752279AbbGGGgD (ORCPT ); Tue, 7 Jul 2015 02:36:03 -0400 Received: from mail-la0-f54.google.com ([209.85.215.54]:36567 "EHLO mail-la0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751885AbbGGGgA (ORCPT ); Tue, 7 Jul 2015 02:36:00 -0400 Received: by lagc2 with SMTP id c2so181561298lag.3 for ; Mon, 06 Jul 2015 23:35:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Ttk/WqOXESP/bZrY9BkIlbVGgmOWQ+6sUvTTJBOOSWA=; b=LcpjFLRV8vtXoDuTsmTZjDADXzuWt9VvMxBNl2SKr/ZMKxgl1oTIjf93E5Z7wbjgTA C8me5u+t2IByvVYw2Mg8+Tt/cd4P6XH5AKOvOX1eXwPOMGM2V2lisrCPzWtOUwNCPXCe upvfbIuQVZSQVxeqqRFhBRQRpIqNhdq9QSg84ewdsUxPQT3F+bXsdIO6HfOSr1ShBxMJ O8ZhCt289NkBTlkhOItxJRksV/hban+TJXuImhI7SwTAAtnPsontdrO9BnUAoq2QqLXC qr9Hl9qxSR8rnv+FdJUL/pXVJnHg5Nv7Jf45+OfN63b53PCXl9sh5RqPNriZADV7lmCx IXbQ== X-Received: by 10.113.10.135 with SMTP id ea7mr2476082lbd.65.1436250959370; Mon, 06 Jul 2015 23:35:59 -0700 (PDT) Received: by 10.112.74.133 with HTTP; Mon, 6 Jul 2015 23:35:59 -0700 (PDT) In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: On Sun, Jul 5, 2015 at 11:38 PM, Johannes Schindelin wrote: > On 2015-07-02 20:16, Paul Tan wrote: > >> diff --git a/t/t4150-am.sh b/t/t4150-am.sh >> index 3f54bdf..0a19136 100755 >> --- a/t/t4150-am.sh >> +++ b/t/t4150-am.sh >> @@ -154,6 +154,17 @@ test_expect_success 'am applies patch correctly' ' >> test "$(git rev-parse second^)" = "$(git rev-parse HEAD^)" >> ' >> >> +test_expect_success 'am fails if index is dirty' ' >> + test_when_finished "rm -fr dirtyfile" && > > Seeing as you `git add` that file further down, how about `git rm -f dirtfile` here? But "git rm -f" would fail if the file is not in the index, no? (Which could happen if the git-reset or git-checkout fails) Anyway, the purpose of the "rm -f" is to remove the dirtyfile, and not to clean up the index (we would use git reset --hard for that). (But yeah, I see that Junio noticed correctly that it should not be a rm -fr, but a rm -f instead.) Thanks, Paul