From patchwork Tue Apr 23 08:53:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 10912345 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7A0911708 for ; Tue, 23 Apr 2019 08:54:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A7921FFEB for ; Tue, 23 Apr 2019 08:54:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5E9C5286F2; Tue, 23 Apr 2019 08:54:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 07F4E1FFEB for ; Tue, 23 Apr 2019 08:54:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726586AbfDWIyC (ORCPT ); Tue, 23 Apr 2019 04:54:02 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:38634 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725888AbfDWIyC (ORCPT ); Tue, 23 Apr 2019 04:54:02 -0400 Received: by mail-pg1-f196.google.com with SMTP id j26so7262532pgl.5 for ; Tue, 23 Apr 2019 01:54:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=edS0/w9kqCKhoefxLNmTwht+sSOhW/i7QMD6DcixPO0=; b=qIjT5m1csQ2n1mvTnYbs5zHMlmiDnwKq8ydM5rVA5LkLn79higGcLbPhmQ173NGhkI hLUSxJGXxEzbLZTjrWiRXUqfSbwSryQHI2VXVBQReANmm6zPhgKjpTDTP2SkIE4sF1YV /quwGMtppemWcWMbUkLfCa+pk0MRZLxrZOrixJvdvTInTYm8zwtfsIewco4q+sUPEwKr y2cA2PKfElV38QOHLG4LmJU0PgNT/NHDZGk4Ro0ytg0+ticEn29SHEiiaESOXZBAa2xY cwzSDveZm0R4mLyuDm91VxtJRnM2FYeh8LY+bISYYDYNWTO5Cdyy11n7YDi8UROzJMIJ NEEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=edS0/w9kqCKhoefxLNmTwht+sSOhW/i7QMD6DcixPO0=; b=bOb4wwkPiLYOxWxF8d3MTavRBiLPOVkNIA36+/Ub+rxcZ5bNWyTDOGc43yxCHNUlLL D+Xr047N5aH9oQ3sUG2OcJdrNC8E3Jq1eouu3i/suYbkIlFAn46u0DFw+yY5xyJqvkpw nvprhe3irbTSJKG+hTS6EMr/I5cNUd1QI4QU9bPRwkG4VY9xdLHvPGkUnlcwoZ3c+2Bh 1Jt19QS9hbsm3redwak9ujpi+bXyV9GkuS+QSjk/1CuUiEcsdO3n9fJT/SYLNjy0IST2 n5JJkqW5zI/m6x/I9njnUe53wS6ewSIb9eGEy1hgKEd6usMMMgQh+zmSNfPd98UCtsWU YmcQ== X-Gm-Message-State: APjAAAUTDlDfISzYlGcV7+WRf5kT5bmS317FwG+wzo05BbGrsOQf2wKs 08ZY7mZoS0ElKKlKAlau4R6vIJXm X-Google-Smtp-Source: APXvYqwXYCTDXsRJPF0j7ZEQSBL3cMFDKBQq5Tde8jDImyUgsncBqSgNFCvQV9ia8yMG95ZSErv6tA== X-Received: by 2002:a63:82c6:: with SMTP id w189mr3107737pgd.444.1556009641099; Tue, 23 Apr 2019 01:54:01 -0700 (PDT) Received: from archbookpro.localdomain (c-73-222-73-77.hsd1.ca.comcast.net. [73.222.73.77]) by smtp.gmail.com with ESMTPSA id p20sm12803366pgj.86.2019.04.23.01.54.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Apr 2019 01:54:00 -0700 (PDT) Date: Tue, 23 Apr 2019 01:53:58 -0700 From: Denton Liu To: Git Mailing List Cc: Johannes Schindelin , David Aguilar , Jeff Hostetler , Eric Sunshine Subject: [PATCH v2 1/5] t7610: add mergetool --gui tests Message-ID: <678f9b11fc7df7d3ee2050388574bcaea86af331.1556009181.git.liu.denton@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In 063f2bdbf7 (mergetool: accept -g/--[no-]gui as arguments, 2018-10-24), mergetool was taught the --gui option but no tests were added to ensure that it was working properly. Add a test to ensure that it works. Signed-off-by: Denton Liu --- t/t7610-mergetool.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh index a9fb971615..5f37d7a1ff 100755 --- a/t/t7610-mergetool.sh +++ b/t/t7610-mergetool.sh @@ -145,6 +145,28 @@ test_expect_success 'custom mergetool' ' git commit -m "branch1 resolved with mergetool" ' +test_expect_success 'gui mergetool' ' + test_config merge.guitool myguitool && + test_config mergetool.myguitool.cmd "(printf \"gui \" && cat \"\$REMOTE\") >\"\$MERGED\"" && + test_config mergetool.myguitool.trustExitCode true && + test_when_finished "git reset --hard" && + git checkout -b test$test_count branch1 && + git submodule update -N && + test_must_fail git merge master >/dev/null 2>&1 && + ( yes "" | git mergetool --gui both >/dev/null 2>&1 ) && + ( yes "" | git mergetool -g file1 file1 ) && + ( yes "" | git mergetool --gui file2 "spaced name" >/dev/null 2>&1 ) && + ( yes "" | git mergetool --gui subdir/file3 >/dev/null 2>&1 ) && + ( yes "d" | git mergetool --gui file11 >/dev/null 2>&1 ) && + ( yes "d" | git mergetool --gui file12 >/dev/null 2>&1 ) && + ( yes "l" | git mergetool --gui submod >/dev/null 2>&1 ) && + test "$(cat file1)" = "gui master updated" && + test "$(cat file2)" = "gui master new" && + test "$(cat subdir/file3)" = "gui master new sub" && + test "$(cat submod/bar)" = "branch1 submodule" && + git commit -m "branch1 resolved with mergetool" +' + test_expect_success 'mergetool crlf' ' test_when_finished "git reset --hard" && # This test_config line must go after the above reset line so that