From patchwork Fri Sep 25 17:02:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubham Verma X-Patchwork-Id: 11800419 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CE4CA6CA for ; Fri, 25 Sep 2020 17:03:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9CD58208B6 for ; Fri, 25 Sep 2020 17:03:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eL++Cw21" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728121AbgIYRDQ (ORCPT ); Fri, 25 Sep 2020 13:03:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727749AbgIYRDQ (ORCPT ); Fri, 25 Sep 2020 13:03:16 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7D30C0613CE for ; Fri, 25 Sep 2020 10:03:15 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id y14so3091278pgf.12 for ; Fri, 25 Sep 2020 10:03:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vmW/fZstOZhPLL4ZmE2ESKtzfWsrN1mWmcALpZxf0Lk=; b=eL++Cw21yJC3egS58hzC69RK4rqsyVXKIKesA83DKeBkyOD9RKsJcktj3E2EfrELES cwLaCmchnoAd560NjpjLClVMskZqRZB3UYvMLGc79oJvFD+G029gPGjZ0nN4W/SYLxwd Cc4KWZU93DwuvqUaQmXCuHmY/9qOVDdQzRXiAMAulwQZSS6Ij1mS83f6TyTGCrSZRF/b /+2KSf/PTHOACkxlyFFSJ4/VOkaqCUFDKNRbPGqJtx/ufqMpiPoDT6YOKat+vf5Tcqc8 WqgS/mftyoO9oPVDqs2R9zf4IyUlnRLYKBaTc+MFynjLzW0rGsdZeVBg/wFbZFD2YD2s deSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vmW/fZstOZhPLL4ZmE2ESKtzfWsrN1mWmcALpZxf0Lk=; b=RFuOGuilP4YsOaTvatYUEdFnk1bKF7zlX/n8ZyTRlKIt4mvlPELHngOlFUVIImFybg fgNOAd+E4bK1xuwY8FsEqK59XqqnsKzJYzcWUcZT9oQSMpYZZrTKLBqui+YwMZCpqzI/ PaYfBHtU3CK779BeJKp9mguZY39VArkwA7T09sszgJBU4ritWoILPyduDz9FsrmNcRmC nQLtAYvqZKWe0ikRBfsnfvFXsEl+Etu3BkuF2ijVIS5/asjMAQCoCOn/ummHi39H11kN hzgJPQ4dM+vreEamX0vrIwBBQqboPiTHjw9dlRERsX74Al6K13iUf2SZ0GA6Oy/B6x5f oJ9Q== X-Gm-Message-State: AOAM532Sq+3Lm0Hnf8w20k131khhE9+SnUknyoLMaYbpSoEqERk2zHb7 SNFblIIGzDGoO8LirU3xwWIwGJNynSQu+Q== X-Google-Smtp-Source: ABdhPJxN2oXHHLoxV4jO9iypEwjXogo8pAi/ayu985SQ3ouXi3JJ66zkuk5US/f8UKXCUsI0PxAfvQ== X-Received: by 2002:a63:c30a:: with SMTP id c10mr807993pgd.377.1601053394821; Fri, 25 Sep 2020 10:03:14 -0700 (PDT) Received: from localhost.localdomain ([47.9.163.48]) by smtp.gmail.com with ESMTPSA id k27sm2822467pgm.29.2020.09.25.10.03.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Sep 2020 10:03:14 -0700 (PDT) From: shubham verma To: git@vger.kernel.org Cc: Shubham Verma Subject: [PATCH 01/11] t7001: convert tests from the old style to the current style Date: Fri, 25 Sep 2020 22:32:46 +0530 Message-Id: <20200925170256.11490-2-shubhunic@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200925170256.11490-1-shubhunic@gmail.com> References: <20200925170256.11490-1-shubhunic@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Shubham Verma To modernize the t7001 test script, let's change the style of its tests from an old one to the modern one. Signed-off-by: shubham verma --- t/t7001-mv.sh | 192 +++++++++++++++++++++++++------------------------- 1 file changed, 96 insertions(+), 96 deletions(-) diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index 63d5f41a12..4bbb51e578 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -3,74 +3,74 @@ test_description='git mv in subdirs' . ./test-lib.sh -test_expect_success \ - 'prepare reference tree' \ - 'mkdir path0 path1 && +test_expect_success 'prepare reference tree' ' + mkdir path0 path1 && cp "$TEST_DIRECTORY"/../COPYING path0/COPYING && git add path0/COPYING && - git commit -m add -a' + git commit -m add -a +' -test_expect_success \ - 'moving the file out of subdirectory' \ - 'cd path0 && git mv COPYING ../path1/COPYING' +test_expect_success 'moving the file out of subdirectory' ' + cd path0 && git mv COPYING ../path1/COPYING +' # in path0 currently -test_expect_success \ - 'commiting the change' \ - 'cd .. && git commit -m move-out -a' +test_expect_success 'commiting the change' ' + cd .. && git commit -m move-out -a +' -test_expect_success \ - 'checking the commit' \ - 'git diff-tree -r -M --name-status HEAD^ HEAD >actual && - grep "^R100..*path0/COPYING..*path1/COPYING" actual' +test_expect_success 'checking the commit' ' + git diff-tree -r -M --name-status HEAD^ HEAD >actual && + grep "^R100..*path0/COPYING..*path1/COPYING" actual +' -test_expect_success \ - 'moving the file back into subdirectory' \ - 'cd path0 && git mv ../path1/COPYING COPYING' +test_expect_success 'moving the file back into subdirectory' ' + cd path0 && git mv ../path1/COPYING COPYING +' # in path0 currently -test_expect_success \ - 'commiting the change' \ - 'cd .. && git commit -m move-in -a' - -test_expect_success \ - 'checking the commit' \ - 'git diff-tree -r -M --name-status HEAD^ HEAD >actual && - grep "^R100..*path1/COPYING..*path0/COPYING" actual' - -test_expect_success \ - 'mv --dry-run does not move file' \ - 'git mv -n path0/COPYING MOVED && +test_expect_success 'commiting the change' ' + cd .. && git commit -m move-in -a +' + +test_expect_success 'checking the commit' ' + git diff-tree -r -M --name-status HEAD^ HEAD >actual && + grep "^R100..*path1/COPYING..*path0/COPYING" actual +' + +test_expect_success 'mv --dry-run does not move file' ' + git mv -n path0/COPYING MOVED && test -f path0/COPYING && - test ! -f MOVED' + test ! -f MOVED +' -test_expect_success \ - 'checking -k on non-existing file' \ - 'git mv -k idontexist path0' +test_expect_success 'checking -k on non-existing file' ' + git mv -k idontexist path0 +' -test_expect_success \ - 'checking -k on untracked file' \ - 'touch untracked1 && +test_expect_success 'checking -k on untracked file' ' + touch untracked1 && git mv -k untracked1 path0 && test -f untracked1 && - test ! -f path0/untracked1' + test ! -f path0/untracked1 +' -test_expect_success \ - 'checking -k on multiple untracked files' \ - 'touch untracked2 && +test_expect_success 'checking -k on multiple untracked files' ' + touch untracked2 && git mv -k untracked1 untracked2 path0 && test -f untracked1 && test -f untracked2 && test ! -f path0/untracked1 && - test ! -f path0/untracked2' + test ! -f path0/untracked2 +' -test_expect_success \ - 'checking -f on untracked file with existing target' \ - 'touch path0/untracked1 && +test_expect_success 'checking -f on untracked file with existing target' ' + touch path0/untracked1 && test_must_fail git mv -f untracked1 path0 && test ! -f .git/index.lock && test -f untracked1 && - test -f path0/untracked1' + test -f path0/untracked1 +' # clean up the mess in case bad things happen rm -f idontexist untracked1 untracked2 \ @@ -78,79 +78,79 @@ rm -f idontexist untracked1 untracked2 \ .git/index.lock rmdir path1 -test_expect_success \ - 'moving to absent target with trailing slash' \ - 'test_must_fail git mv path0/COPYING no-such-dir/ && +test_expect_success 'moving to absent target with trailing slash' ' + test_must_fail git mv path0/COPYING no-such-dir/ && test_must_fail git mv path0/COPYING no-such-dir// && git mv path0/ no-such-dir/ && - test_path_is_dir no-such-dir' + test_path_is_dir no-such-dir +' -test_expect_success \ - 'clean up' \ - 'git reset --hard' +test_expect_success 'clean up' ' + git reset --hard +' -test_expect_success \ - 'moving to existing untracked target with trailing slash' \ - 'mkdir path1 && +test_expect_success 'moving to existing untracked target with trailing slash' ' + mkdir path1 && git mv path0/ path1/ && - test_path_is_dir path1/path0/' + test_path_is_dir path1/path0/ +' -test_expect_success \ - 'moving to existing tracked target with trailing slash' \ - 'mkdir path2 && +test_expect_success 'moving to existing tracked target with trailing slash' ' + mkdir path2 && >path2/file && git add path2/file && git mv path1/path0/ path2/ && - test_path_is_dir path2/path0/' + test_path_is_dir path2/path0/ +' -test_expect_success \ - 'clean up' \ - 'git reset --hard' +test_expect_success 'clean up' ' + git reset --hard +' -test_expect_success \ - 'adding another file' \ - 'cp "$TEST_DIRECTORY"/../README.md path0/README && +test_expect_success 'adding another file' ' + cp "$TEST_DIRECTORY"/../README.md path0/README && git add path0/README && - git commit -m add2 -a' + git commit -m add2 -a +' -test_expect_success \ - 'moving whole subdirectory' \ - 'git mv path0 path2' +test_expect_success 'moving whole subdirectory' ' + git mv path0 path2 +' -test_expect_success \ - 'commiting the change' \ - 'git commit -m dir-move -a' +test_expect_success 'commiting the change' ' + git commit -m dir-move -a +' -test_expect_success \ - 'checking the commit' \ - 'git diff-tree -r -M --name-status HEAD^ HEAD >actual && +test_expect_success 'checking the commit' ' + git diff-tree -r -M --name-status HEAD^ HEAD >actual && grep "^R100..*path0/COPYING..*path2/COPYING" actual && - grep "^R100..*path0/README..*path2/README" actual' + grep "^R100..*path0/README..*path2/README" actual +' -test_expect_success \ - 'succeed when source is a prefix of destination' \ - 'git mv path2/COPYING path2/COPYING-renamed' +test_expect_success 'succeed when source is a prefix of destination' ' + git mv path2/COPYING path2/COPYING-renamed +' -test_expect_success \ - 'moving whole subdirectory into subdirectory' \ - 'git mv path2 path1' +test_expect_success 'moving whole subdirectory into subdirectory' ' + git mv path2 path1 +' -test_expect_success \ - 'commiting the change' \ - 'git commit -m dir-move -a' +test_expect_success 'commiting the change' ' + git commit -m dir-move -a +' -test_expect_success \ - 'checking the commit' \ - 'git diff-tree -r -M --name-status HEAD^ HEAD >actual && +test_expect_success 'checking the commit' ' + git diff-tree -r -M --name-status HEAD^ HEAD >actual && grep "^R100..*path2/COPYING..*path1/path2/COPYING" actual && - grep "^R100..*path2/README..*path1/path2/README" actual' + grep "^R100..*path2/README..*path1/path2/README" actual +' -test_expect_success \ - 'do not move directory over existing directory' \ - 'mkdir path0 && mkdir path0/path2 && test_must_fail git mv path2 path0' +test_expect_success 'do not move directory over existing directory' ' + mkdir path0 && mkdir path0/path2 && test_must_fail git mv path2 path0 +' -test_expect_success \ - 'move into "."' \ - 'git mv path1/path2/ .' +test_expect_success 'move into "."' ' + git mv path1/path2/ . +' test_expect_success "Michael Cassar's test case" ' rm -fr .git papers partA && From patchwork Fri Sep 25 17:02:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubham Verma X-Patchwork-Id: 11800423 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8F367618 for ; Fri, 25 Sep 2020 17:03:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 66D8320936 for ; Fri, 25 Sep 2020 17:03:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="W6hj7o9f" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728487AbgIYRDT (ORCPT ); Fri, 25 Sep 2020 13:03:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728423AbgIYRDS (ORCPT ); Fri, 25 Sep 2020 13:03:18 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E066C0613CE for ; Fri, 25 Sep 2020 10:03:18 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id l71so3114674pge.4 for ; Fri, 25 Sep 2020 10:03:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5w0xbVu+QDOUf8+PXLyGTgd8PzAwCFtfEinbJhY9xu4=; b=W6hj7o9fUsIAKyiop+H1Is8FCSQ9yh2smj+3jEVH/UllOeDh4+JmbCELPwrDNKRg8G BsEJP3BRj8dRaDoz7Tm0tlW/QdDDFAvAr7RWQLVJhcF+flnqbWHgq6aL52q+y8UDKGOS ua/zQS8AGc13YiPcL3P8sMw9mK999F5WPHPK8SbRqNrjHR28qdgZgfXZuzFqWsB2em9k O9VuGIticDi90ScJhMrq7OG5o9dNY4E07Pkwu6vyRLucjBLPsUl14ByvEw0hF2aia9ji WOUIY/uobJabZpj5ckaQYhf1q19E7u5FvPIqwQhLBD6CVlCBfiVrVEvWv0UyYpwDiBjp 2y8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5w0xbVu+QDOUf8+PXLyGTgd8PzAwCFtfEinbJhY9xu4=; b=Ajr1hiYainjrqMZjNLq+aulE02nvsa6uaTGJ1q6MczHD5pGs721L6rLNWWMYKkL1uo mCu4EsSLHe9TE0BqFjodXj2A1tZerLXz4Sm/w+Zk1cRI7N8Y8G/Mj9dZ2DZK+r35248e G3Cxm34LP8eeR/6nLIvJjVvCysmx/SkkCYZvrWreyVhka8FiKsELVidgwtKhyQl6uEOD wUwpA9BdxL6nf12tEVzhjKl+b3dJIUEE3jTXwpNy9HuqA4wZJyrYUad/IFMldgbDZYDR TGvKoSPhFbAOh9526N8/ZPHfkWMwxZFt1Jz6gYuY8G2fygoNwEbIdlbfY7OFlcrsk4F7 Pkjg== X-Gm-Message-State: AOAM532odHaWc7x/fLwMLLj4OoqStU4vFpV4/dBGb6ydt1CWfLvJ2lCF b33X/7A8gZIwWXp1oGQgxyy/fTnfXShuJQ== X-Google-Smtp-Source: ABdhPJwc/jXcnMcTJBRDX7B6dBAv43pcV1djwlRozTvhPuN+b7yiwlVne3EHRq3rsvP4eI3vucDAEw== X-Received: by 2002:a17:902:9041:b029:d0:cc02:8540 with SMTP id w1-20020a1709029041b02900d0cc028540mr292780plz.41.1601053397582; Fri, 25 Sep 2020 10:03:17 -0700 (PDT) Received: from localhost.localdomain ([47.9.163.48]) by smtp.gmail.com with ESMTPSA id k27sm2822467pgm.29.2020.09.25.10.03.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Sep 2020 10:03:17 -0700 (PDT) From: shubham verma To: git@vger.kernel.org Cc: Shubham Verma Subject: [PATCH 02/11] t7001: use TAB instead of spaces Date: Fri, 25 Sep 2020 22:32:47 +0530 Message-Id: <20200925170256.11490-3-shubhunic@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200925170256.11490-1-shubhunic@gmail.com> References: <20200925170256.11490-1-shubhunic@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Shubham Verma Change indentation style from spaces to TAB. Signed-off-by: shubham verma --- t/t7001-mv.sh | 120 +++++++++++++++++++++++++------------------------- 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index 4bbb51e578..7503233814 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -4,72 +4,72 @@ test_description='git mv in subdirs' . ./test-lib.sh test_expect_success 'prepare reference tree' ' - mkdir path0 path1 && - cp "$TEST_DIRECTORY"/../COPYING path0/COPYING && - git add path0/COPYING && - git commit -m add -a + mkdir path0 path1 && + cp "$TEST_DIRECTORY"/../COPYING path0/COPYING && + git add path0/COPYING && + git commit -m add -a ' test_expect_success 'moving the file out of subdirectory' ' - cd path0 && git mv COPYING ../path1/COPYING + cd path0 && git mv COPYING ../path1/COPYING ' # in path0 currently test_expect_success 'commiting the change' ' - cd .. && git commit -m move-out -a + cd .. && git commit -m move-out -a ' test_expect_success 'checking the commit' ' - git diff-tree -r -M --name-status HEAD^ HEAD >actual && - grep "^R100..*path0/COPYING..*path1/COPYING" actual + git diff-tree -r -M --name-status HEAD^ HEAD >actual && + grep "^R100..*path0/COPYING..*path1/COPYING" actual ' test_expect_success 'moving the file back into subdirectory' ' - cd path0 && git mv ../path1/COPYING COPYING + cd path0 && git mv ../path1/COPYING COPYING ' # in path0 currently test_expect_success 'commiting the change' ' - cd .. && git commit -m move-in -a + cd .. && git commit -m move-in -a ' test_expect_success 'checking the commit' ' - git diff-tree -r -M --name-status HEAD^ HEAD >actual && - grep "^R100..*path1/COPYING..*path0/COPYING" actual + git diff-tree -r -M --name-status HEAD^ HEAD >actual && + grep "^R100..*path1/COPYING..*path0/COPYING" actual ' test_expect_success 'mv --dry-run does not move file' ' - git mv -n path0/COPYING MOVED && - test -f path0/COPYING && - test ! -f MOVED + git mv -n path0/COPYING MOVED && + test -f path0/COPYING && + test ! -f MOVED ' test_expect_success 'checking -k on non-existing file' ' - git mv -k idontexist path0 + git mv -k idontexist path0 ' test_expect_success 'checking -k on untracked file' ' - touch untracked1 && - git mv -k untracked1 path0 && - test -f untracked1 && - test ! -f path0/untracked1 + touch untracked1 && + git mv -k untracked1 path0 && + test -f untracked1 && + test ! -f path0/untracked1 ' test_expect_success 'checking -k on multiple untracked files' ' - touch untracked2 && - git mv -k untracked1 untracked2 path0 && - test -f untracked1 && - test -f untracked2 && - test ! -f path0/untracked1 && - test ! -f path0/untracked2 + touch untracked2 && + git mv -k untracked1 untracked2 path0 && + test -f untracked1 && + test -f untracked2 && + test ! -f path0/untracked1 && + test ! -f path0/untracked2 ' test_expect_success 'checking -f on untracked file with existing target' ' - touch path0/untracked1 && - test_must_fail git mv -f untracked1 path0 && - test ! -f .git/index.lock && - test -f untracked1 && - test -f path0/untracked1 + touch path0/untracked1 && + test_must_fail git mv -f untracked1 path0 && + test ! -f .git/index.lock && + test -f untracked1 && + test -f path0/untracked1 ' # clean up the mess in case bad things happen @@ -79,77 +79,77 @@ rm -f idontexist untracked1 untracked2 \ rmdir path1 test_expect_success 'moving to absent target with trailing slash' ' - test_must_fail git mv path0/COPYING no-such-dir/ && - test_must_fail git mv path0/COPYING no-such-dir// && - git mv path0/ no-such-dir/ && - test_path_is_dir no-such-dir + test_must_fail git mv path0/COPYING no-such-dir/ && + test_must_fail git mv path0/COPYING no-such-dir// && + git mv path0/ no-such-dir/ && + test_path_is_dir no-such-dir ' test_expect_success 'clean up' ' - git reset --hard + git reset --hard ' test_expect_success 'moving to existing untracked target with trailing slash' ' - mkdir path1 && - git mv path0/ path1/ && - test_path_is_dir path1/path0/ + mkdir path1 && + git mv path0/ path1/ && + test_path_is_dir path1/path0/ ' test_expect_success 'moving to existing tracked target with trailing slash' ' - mkdir path2 && - >path2/file && git add path2/file && - git mv path1/path0/ path2/ && - test_path_is_dir path2/path0/ + mkdir path2 && + >path2/file && git add path2/file && + git mv path1/path0/ path2/ && + test_path_is_dir path2/path0/ ' test_expect_success 'clean up' ' - git reset --hard + git reset --hard ' test_expect_success 'adding another file' ' - cp "$TEST_DIRECTORY"/../README.md path0/README && - git add path0/README && - git commit -m add2 -a + cp "$TEST_DIRECTORY"/../README.md path0/README && + git add path0/README && + git commit -m add2 -a ' test_expect_success 'moving whole subdirectory' ' - git mv path0 path2 + git mv path0 path2 ' test_expect_success 'commiting the change' ' - git commit -m dir-move -a + git commit -m dir-move -a ' test_expect_success 'checking the commit' ' - git diff-tree -r -M --name-status HEAD^ HEAD >actual && - grep "^R100..*path0/COPYING..*path2/COPYING" actual && - grep "^R100..*path0/README..*path2/README" actual + git diff-tree -r -M --name-status HEAD^ HEAD >actual && + grep "^R100..*path0/COPYING..*path2/COPYING" actual && + grep "^R100..*path0/README..*path2/README" actual ' test_expect_success 'succeed when source is a prefix of destination' ' - git mv path2/COPYING path2/COPYING-renamed + git mv path2/COPYING path2/COPYING-renamed ' test_expect_success 'moving whole subdirectory into subdirectory' ' - git mv path2 path1 + git mv path2 path1 ' test_expect_success 'commiting the change' ' - git commit -m dir-move -a + git commit -m dir-move -a ' test_expect_success 'checking the commit' ' - git diff-tree -r -M --name-status HEAD^ HEAD >actual && - grep "^R100..*path2/COPYING..*path1/path2/COPYING" actual && - grep "^R100..*path2/README..*path1/path2/README" actual + git diff-tree -r -M --name-status HEAD^ HEAD >actual && + grep "^R100..*path2/COPYING..*path1/path2/COPYING" actual && + grep "^R100..*path2/README..*path1/path2/README" actual ' test_expect_success 'do not move directory over existing directory' ' - mkdir path0 && mkdir path0/path2 && test_must_fail git mv path2 path0 + mkdir path0 && mkdir path0/path2 && test_must_fail git mv path2 path0 ' test_expect_success 'move into "."' ' - git mv path1/path2/ . + git mv path1/path2/ . ' test_expect_success "Michael Cassar's test case" ' From patchwork Fri Sep 25 17:02:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubham Verma X-Patchwork-Id: 11800425 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AA6966CA for ; Fri, 25 Sep 2020 17:03:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8BC3B21D42 for ; Fri, 25 Sep 2020 17:03:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XxlfTMcU" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728610AbgIYRDV (ORCPT ); Fri, 25 Sep 2020 13:03:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726401AbgIYRDV (ORCPT ); Fri, 25 Sep 2020 13:03:21 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E2F7C0613CE for ; Fri, 25 Sep 2020 10:03:21 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id d13so3108095pgl.6 for ; Fri, 25 Sep 2020 10:03:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wgaplaltBQYeqEYWxNUek72WSVLLhXd818GgBmGmTB4=; b=XxlfTMcUEb05+PLmAtHdhUoe0bFpnzv9Ctr4uu5TfDf3KYWKiUiSabYwhSjz8M2tAp fbtOv65v1+o3dQU6wt/YjvhFRwgzEp3jzIrbZHi3JutaWHYEIO+o13Yy14mLajdSlVL0 +exHCYdug5n9X4pO82QcVC6SNMHuT8WmVbBlqNf+nJ5ZlFKkEI2pa0o5iVxj0a+fToA3 a0BEDpZsVUPWlAJvJSOyfFsya8rrl1zfYrPU5A1lvtg84zw3lNHJc55L56TNfLEdT/N3 bSxzJ17JwIGesNMlF9T3Qd02VX6z9otonb92D26itpsNz/ucLF3tTFeGQSwPKGRrUKb/ 9FKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wgaplaltBQYeqEYWxNUek72WSVLLhXd818GgBmGmTB4=; b=r2RG1tz63DzbjdJ3gSDlpWM25Dq6MoXYiwFWo15koHQDFPj3QZETdLjUKZdGz7Fhm6 800oxNKe6aH7in23XP4uwHd/UDR8fcZNPg0BGAMUDSugBu6ouiYefZZ4VNtia1qGBz2A Qnl+AupU0i9SZD4D8Uz7h0dn5os0vYx2FM28XJ0Sqs4LzV1y5T9v5n/ZCV4LLGenlHQj c+T2lwRKxV/UdYVv27BkUxfVCJTKlOta3Mhl5rRo4t3NtsoXI+7JHCxOYPNVn2pHnSqm AeWA5yhkIed0TRjqeX/6sPHrjtCJQWdqS9L9usWKdhdL+gJQrIpvGDF9eceIYTUiXB6T 4DRQ== X-Gm-Message-State: AOAM531Au+8f/c/clfJxhyAuwOOoitKwIA30fXjontvdqoHyKm/DGzmh pEHRJNregYh3nQby538Jscz9yq5KgGdd0A== X-Google-Smtp-Source: ABdhPJwooriF+OxXLM5KUnJKebedBEL3yXGHX8zqwlowld7VzaLulKG8mnMkI3Hk430teshyax3sJQ== X-Received: by 2002:a63:fd08:: with SMTP id d8mr843223pgh.223.1601053400335; Fri, 25 Sep 2020 10:03:20 -0700 (PDT) Received: from localhost.localdomain ([47.9.163.48]) by smtp.gmail.com with ESMTPSA id k27sm2822467pgm.29.2020.09.25.10.03.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Sep 2020 10:03:19 -0700 (PDT) From: shubham verma To: git@vger.kernel.org Cc: Shubham Verma Subject: [PATCH 03/11] t7001: remove unnecessary blank lines Date: Fri, 25 Sep 2020 22:32:48 +0530 Message-Id: <20200925170256.11490-4-shubhunic@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200925170256.11490-1-shubhunic@gmail.com> References: <20200925170256.11490-1-shubhunic@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Shubham Verma Some tests use a deprecated style in which there are unnecessary blank lines after the opening quote of the test body and before the closing quote. So we should removed these unnecessary blank lines. Signed-off-by: shubham verma --- t/t7001-mv.sh | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index 7503233814..f63802442b 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -182,7 +182,6 @@ test_expect_success "Sergey Vlasov's test case" ' ' test_expect_success 'absolute pathname' '( - rm -fr mine && mkdir mine && cd mine && @@ -196,12 +195,9 @@ test_expect_success 'absolute pathname' '( ! test -d sub && test -d in && git ls-files --error-unmatch in/file - - )' test_expect_success 'absolute pathname outside should fail' '( - rm -fr mine && mkdir mine && cd mine && @@ -216,7 +212,6 @@ test_expect_success 'absolute pathname outside should fail' '( test -d sub && ! test -d ../in && git ls-files --error-unmatch sub/file - )' test_expect_success 'git mv to move multiple sources into a directory' ' @@ -232,7 +227,6 @@ test_expect_success 'git mv to move multiple sources into a directory' ' ' test_expect_success 'git mv should not change sha1 of moved cache entry' ' - rm -fr .git && git init && echo 1 >dirty && @@ -243,7 +237,6 @@ test_expect_success 'git mv should not change sha1 of moved cache entry' ' echo 2 >dirty2 && git mv dirty2 dirty && [ "$entry" = "$(git ls-files --stage dirty | cut -f 1)" ] - ' rm -f dirty dirty2 @@ -266,7 +259,6 @@ test_expect_success 'git mv error on conflicted file' ' ' test_expect_success 'git mv should overwrite symlink to a file' ' - rm -fr .git && git init && echo 1 >moved && @@ -279,13 +271,11 @@ test_expect_success 'git mv should overwrite symlink to a file' ' test "$(cat symlink)" = 1 && git update-index --refresh && git diff-files --quiet - ' rm -f moved symlink test_expect_success 'git mv should overwrite file with a symlink' ' - rm -fr .git && git init && echo 1 >moved && @@ -296,11 +286,9 @@ test_expect_success 'git mv should overwrite file with a symlink' ' ! test -e symlink && git update-index --refresh && git diff-files --quiet - ' test_expect_success SYMLINKS 'check moved symlink' ' - test -h moved ' From patchwork Fri Sep 25 17:02:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubham Verma X-Patchwork-Id: 11800427 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3F51F6CA for ; Fri, 25 Sep 2020 17:03:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 223DB20936 for ; Fri, 25 Sep 2020 17:03:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kceSB8VO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728887AbgIYRDY (ORCPT ); Fri, 25 Sep 2020 13:03:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726401AbgIYRDY (ORCPT ); Fri, 25 Sep 2020 13:03:24 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDE38C0613CE for ; Fri, 25 Sep 2020 10:03:23 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id y14so3091590pgf.12 for ; Fri, 25 Sep 2020 10:03:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bD6MobUJibAkB8t3H1uIlFYDJVbhdGRbdmiajUhrcDE=; b=kceSB8VOPvnISdGxk4Vq68xaCHRR+blDxwuv7X1Je07YUXStXF0uODpanty50sVERC Mlu3GSb7VzMjlaZewmR1KE3Nmb+3QpTEpFg5smp5aQ2VgUyd6VCrQ1Xgijh8jRe2WcRs g5evrV8G9ZP546tqcSFw53LS7ZZ0kGNn5rskbU+i/qgOw/6otXALDqY+m3hJd07BnFWZ KQ6QEMaTjCgJ67SVx2OsyXAQbOgPEDbrICiXB6kbKGCxtLNYAvqwEaoWHhf5bY7Bvllj n9+RjUrugY2vAoUUtB4A7jFmAKfFNfJFRGfJNK/bOyPSyUU70Lq0ggINfJGjEcLWRct/ 1hxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bD6MobUJibAkB8t3H1uIlFYDJVbhdGRbdmiajUhrcDE=; b=QafKG5LLJvQFKN8zcrkbC1FwcS5Xwy3ZqRAvK3xeyyZb6n7HGayfyJCAK2kZP/Fkut GK7qtIqSls/x4ivBRVZzX6CRQ58LXxqXVdY03nOMOF+0h4nWLDA4SUjRkBq2nwxOIfMr +6FUYptglVFvTNommxWmzy+bL9MjIpS6Q1C6gzhzgkRw1QQyxIXe3cu5q6bGtEeAdEy3 IrifkkRAopoJJWHKxYCjOD49JpGCLKzQAL0aj3fwhMYWajL9b55L0nlkDeEfHN4OY+jd TxKP3ID4TNYZ14t4Bh/aBMrEoRDCevJ1m5J/xv5aQxbmqh5omSmUbv06piD3jLqQiqpX qE4w== X-Gm-Message-State: AOAM531SbHeFKQtbLVAiSYHdGkLVOwaFjmTtr20WgpyeFIdbhZP2hrhQ u2jWmltT3jU0CRcZ2tpAx+dSZJ3PgOYspg== X-Google-Smtp-Source: ABdhPJzkA9cEw3E7nZ3YuDN3sY01nWlTzjVnhtfO701iyRVxgbniJK3XjsarFVYO138K7uXGsngvCA== X-Received: by 2002:a63:c64f:: with SMTP id x15mr818775pgg.135.1601053402968; Fri, 25 Sep 2020 10:03:22 -0700 (PDT) Received: from localhost.localdomain ([47.9.163.48]) by smtp.gmail.com with ESMTPSA id k27sm2822467pgm.29.2020.09.25.10.03.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Sep 2020 10:03:22 -0700 (PDT) From: shubham verma To: git@vger.kernel.org Cc: Shubham Verma Subject: [PATCH 04/11] t7001: change the style for cd according to subshell Date: Fri, 25 Sep 2020 22:32:49 +0530 Message-Id: <20200925170256.11490-5-shubhunic@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200925170256.11490-1-shubhunic@gmail.com> References: <20200925170256.11490-1-shubhunic@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Shubham Verma In some tests there is not a proper spaces after opening paranthesis and before cd. So, Lets change the style for cd according to subshell. Signed-off-by: shubham verma --- t/t7001-mv.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index f63802442b..67585b7d94 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -503,14 +503,16 @@ test_expect_success 'moving a submodule in nested directories' ' test_expect_success 'moving nested submodules' ' git commit -am "cleanup commit" && mkdir sub_nested_nested && - (cd sub_nested_nested && + ( + cd sub_nested_nested && touch nested_level2 && git init && git add . && git commit -m "nested level 2" ) && mkdir sub_nested && - (cd sub_nested && + ( + cd sub_nested && touch nested_level1 && git init && git add . && From patchwork Fri Sep 25 17:02:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubham Verma X-Patchwork-Id: 11800429 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C4BD5618 for ; Fri, 25 Sep 2020 17:03:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AAF5A21D42 for ; Fri, 25 Sep 2020 17:03:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZzPjUcct" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729078AbgIYRD1 (ORCPT ); Fri, 25 Sep 2020 13:03:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726401AbgIYRD0 (ORCPT ); Fri, 25 Sep 2020 13:03:26 -0400 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 179CAC0613CE for ; Fri, 25 Sep 2020 10:03:26 -0700 (PDT) Received: by mail-pf1-x42e.google.com with SMTP id k13so3788603pfg.1 for ; Fri, 25 Sep 2020 10:03:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lNsqDMFnGvUZwq/IKUAAr2ueT9TE0q11LCex7uvkQ3U=; b=ZzPjUcctJuicPTHdwCSeN0o2BtCynr3haejYm8qhp6Ipe/KPDcYe8u/9XkVj1XltzQ jQUECB6tQNu4UvszE22jHUZdhqcW7RYUMi7fBSQzJP4JmjgFaj/spRdpzvfgCEqYuXHF un2WRQN3924lE2ExL1RQmOOHyKFdOMT9eJ9d80NXU3vdHjlvVNsbAgl3Mq7vJl/Q/ptU oumK4cQAgG/qeqWy9/WO5j5UxvZiRFHC0LhouDerEt8Ak7oydYVka59Zj0N2bagBmGiU t3gccBCD8OSL+bvvI9TrHFuydjXRD/n4u2CK7ZaRQ+7qWKPHqjPAFqONVozD2vxkcRYk H9Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lNsqDMFnGvUZwq/IKUAAr2ueT9TE0q11LCex7uvkQ3U=; b=KsPJtgqJiDBk32rgHj7gWsNjiPcaIhkZgBJJVY8QHrvGSdTB96HV0UYkA3ZIhLWjQS gfjJ0DWsrvst2QdjKXROuYKZObDhBUTQjttzif6N71zx7w9s9MR7Htoi91qOkrELnWmJ dNEfuP1vMe2RH5OrSoA0f4d5uTVlR+XEeBon6VJjB5QDE37d5eYN2TK/QoB6cWPLH6dm XCbsMtZFqcNDEfODejc68SRk0Rj5Tyl6M2MNSPhpH+jXyUpPGaL4T4dPmAu/0Qozica/ ez6+WlBSGOh7Tu0sAygejcyIzacx4MeLnNH7p1NGI8IpLUmt2gSQuXncV302ZyDdFaNG LqWQ== X-Gm-Message-State: AOAM533RG7n8g0IAE01eBEbb6FiJU+JVDuf1nl3O9EJJd0NObtkpLwOp j5zjzYwcHe1P72XcQ5a8MYg1LtKHtBszpA== X-Google-Smtp-Source: ABdhPJxetq6JPWuo9nAPLujyhai4LOAWDOrdEB83zbDWOoyhZOMtld3UrOF3RVLWS2YWnFwXtbNq2A== X-Received: by 2002:a63:2063:: with SMTP id r35mr871445pgm.320.1601053405251; Fri, 25 Sep 2020 10:03:25 -0700 (PDT) Received: from localhost.localdomain ([47.9.163.48]) by smtp.gmail.com with ESMTPSA id k27sm2822467pgm.29.2020.09.25.10.03.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Sep 2020 10:03:24 -0700 (PDT) From: shubham verma To: git@vger.kernel.org Cc: Shubham Verma Subject: [PATCH 05/11] t7001: remove whitespace after redirect operators Date: Fri, 25 Sep 2020 22:32:50 +0530 Message-Id: <20200925170256.11490-6-shubhunic@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200925170256.11490-1-shubhunic@gmail.com> References: <20200925170256.11490-1-shubhunic@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Shubham Verma According to Documentation/CodingGuidelines, there should be no whitespace after redirect operators. So, we should remove these whitespaces after redirect operators. Signed-off-by: shubham verma --- t/t7001-mv.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index 67585b7d94..7581e4b407 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -156,9 +156,9 @@ test_expect_success "Michael Cassar's test case" ' rm -fr .git papers partA && git init && mkdir -p papers/unsorted papers/all-papers partA && - echo a > papers/unsorted/Thesis.pdf && - echo b > partA/outline.txt && - echo c > papers/unsorted/_another && + echo a >papers/unsorted/Thesis.pdf && + echo b >partA/outline.txt && + echo c >papers/unsorted/_another && git add papers partA && T1=$(git write-tree) && From patchwork Fri Sep 25 17:02:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubham Verma X-Patchwork-Id: 11800431 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 88F5A6CA for ; Fri, 25 Sep 2020 17:03:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 611C521D42 for ; Fri, 25 Sep 2020 17:03:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MJHzuelM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729125AbgIYRD3 (ORCPT ); Fri, 25 Sep 2020 13:03:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726401AbgIYRD2 (ORCPT ); Fri, 25 Sep 2020 13:03:28 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9274C0613CE for ; Fri, 25 Sep 2020 10:03:28 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id f18so3757208pfa.10 for ; Fri, 25 Sep 2020 10:03:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Dfk/t+Ic8hEa1xD1DKuZ34g6MVpKRFuB2Wvtp2NR+tg=; b=MJHzuelM2nQMa6M4jYC1rWixa5Jd3PBZvUJaVsuxQXlHJeKQdAppdxWENntv0H5VAE KahE93zPmeXX8MVMVgX2O04gP3g6p+A6Leuh2ttB+j2FQndE1KDDD+rdhLJin0h2XbmW ylRjMnI0SM9eb99Ipf0KjQLN8k1YTTWgU0u/NR0xmXNocfqq/I3pVCBok2uBRbgupMMn Qkkji9VGvz4wtM8tgARurvaPKNVrERgh5vXBQ7cCK1gLDVlWAYN/cyVadqKHaKAxp15A tfdqK3vn5AwiQnHCJhTZ5qh3Ld7ziWJSO61edf00zgDFLDwPHGLztf4b7ZJd1B4esIFH 6xdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Dfk/t+Ic8hEa1xD1DKuZ34g6MVpKRFuB2Wvtp2NR+tg=; b=uFcT68T66XTlxRYI02USlh86lOAVHCSuEO+y1gFY9xKMz0It2Chao9gyIS3/+oUcxC gybdLbpJEB0BZFqc7drBy7IHE9ql++nvIBRrlgc/ESs9qfw6aSWGbRcQ4RCudOgzpn0F rJNjohHXtgFMVTRrK86Gyu0tOIcGSRpAfNblgGWxhp0yw83MuORLy1jhIEFl69fFXTOM RsKmTO8fN4Tv1wBxV5ejHbFU+xjnoVxWxp8ghLMQKt7INdLoZAdFI204VCHOh6hUdO/h kE1SlAYe+783SD4QpVj2hPSaweiH7gsZqphboHIGBmRhLoqdiGPq+LkNrHGwMfwO+r33 pwyA== X-Gm-Message-State: AOAM530TUhfy59JRxBw0B/OCbSNCF/UA94LNcOySc6LOaBzcz/VbdTa2 3Q+OHhaVHbZP/sF4ai6vTaApURSEe3287A== X-Google-Smtp-Source: ABdhPJxwn+HseCEA+Vb3fukneC7jasr9hLPHwxXROz8NHMEWPONBLMRvB++olAV+olf8hfU40K5hMw== X-Received: by 2002:a65:5c8b:: with SMTP id a11mr833193pgt.272.1601053407884; Fri, 25 Sep 2020 10:03:27 -0700 (PDT) Received: from localhost.localdomain ([47.9.163.48]) by smtp.gmail.com with ESMTPSA id k27sm2822467pgm.29.2020.09.25.10.03.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Sep 2020 10:03:27 -0700 (PDT) From: shubham verma To: git@vger.kernel.org Cc: Shubham Verma Subject: [PATCH 06/11] t7001: change (cd && git foo) to (git -C foo) Date: Fri, 25 Sep 2020 22:32:51 +0530 Message-Id: <20200925170256.11490-7-shubhunic@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200925170256.11490-1-shubhunic@gmail.com> References: <20200925170256.11490-1-shubhunic@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Shubham Verma Let's avoid the use of `cd` outside subshells by encapsulating them inside subshells or by using `git -C ...`. Signed-off-by: shubham verma --- t/t7001-mv.sh | 45 +++++++++++---------------------------------- 1 file changed, 11 insertions(+), 34 deletions(-) diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index 7581e4b407..3a3ace6d73 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -11,12 +11,11 @@ test_expect_success 'prepare reference tree' ' ' test_expect_success 'moving the file out of subdirectory' ' - cd path0 && git mv COPYING ../path1/COPYING + git -C path0 mv COPYING ../path1/COPYING ' -# in path0 currently test_expect_success 'commiting the change' ' - cd .. && git commit -m move-out -a + git commit -m move-out -a ' test_expect_success 'checking the commit' ' @@ -25,12 +24,11 @@ test_expect_success 'checking the commit' ' ' test_expect_success 'moving the file back into subdirectory' ' - cd path0 && git mv ../path1/COPYING COPYING + git -C path0 mv ../path1/COPYING COPYING ' -# in path0 currently test_expect_success 'commiting the change' ' - cd .. && git commit -m move-in -a + git commit -m move-in -a ' test_expect_success 'checking the commit' ' @@ -324,10 +322,7 @@ test_expect_success 'git mv moves a submodule with a .git directory and no .gitm git mv sub mod/sub && ! test -e sub && [ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] && - ( - cd mod/sub && - git status - ) && + git -C mod/sub status && git update-index --refresh && git diff-files --quiet ' @@ -347,10 +342,7 @@ test_expect_success 'git mv moves a submodule with a .git directory and .gitmodu git mv sub mod/sub && ! test -e sub && [ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] && - ( - cd mod/sub && - git status - ) && + git -C mod/sub status && echo mod/sub >expected && git config -f .gitmodules submodule.sub.path >actual && test_cmp expected actual && @@ -364,16 +356,10 @@ test_expect_success 'git mv moves a submodule with gitfile' ' git submodule update && entry="$(git ls-files --stage sub | cut -f 1)" && mkdir mod && - ( - cd mod && - git mv ../sub/ . - ) && + git -C mod mv ../sub/ . && ! test -e sub && [ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] && - ( - cd mod/sub && - git status - ) && + git -C mod/sub status && echo mod/sub >expected && git config -f .gitmodules submodule.sub.path >actual && test_cmp expected actual && @@ -392,10 +378,7 @@ test_expect_success 'mv does not complain when no .gitmodules file is found' ' test_must_be_empty actual.err && ! test -e sub && [ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] && - ( - cd mod/sub && - git status - ) && + git -C mod/sub status && git update-index --refresh && git diff-files --quiet ' @@ -416,10 +399,7 @@ test_expect_success 'mv will error out on a modified .gitmodules file unless sta test_must_be_empty actual.err && ! test -e sub && [ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] && - ( - cd mod/sub && - git status - ) && + git -C mod/sub status && git update-index --refresh && git diff-files --quiet ' @@ -437,10 +417,7 @@ test_expect_success 'mv issues a warning when section is not found in .gitmodule test_i18ncmp expect.err actual.err && ! test -e sub && [ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] && - ( - cd mod/sub && - git status - ) && + git -C mod/sub status && git update-index --refresh && git diff-files --quiet ' From patchwork Fri Sep 25 17:02:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubham Verma X-Patchwork-Id: 11800433 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A94CD6CA for ; Fri, 25 Sep 2020 17:03:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 870DE21D42 for ; Fri, 25 Sep 2020 17:03:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JIDoICHn" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729406AbgIYRDb (ORCPT ); Fri, 25 Sep 2020 13:03:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726401AbgIYRDb (ORCPT ); Fri, 25 Sep 2020 13:03:31 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19CCCC0613CE for ; Fri, 25 Sep 2020 10:03:31 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id m34so3101023pgl.9 for ; Fri, 25 Sep 2020 10:03:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=t5faDJt0YXNHD+EUFHtfwCQsOVX8iWPJ+MGU1yXpBnw=; b=JIDoICHn0V2wyn7gToSU9YyMmWId1cZ2/3HQwgUwgsyMW/I5cfX+KEksiWT070qL+a jvRPrWrtPUdGGy/7CQ6wVL7jCgmGzkM3dCvmm5tNYuecrjs+clBKl0r4/FKOtCVsBqk8 grIvRmxOSLlv+CSK6JIdMbcWbcoq6N9i4GJoVStfuCebXx1FqvXd1piMVaH+BWIfmjyY jC2ep/DlTNFrjLnNI6HKl75UpBzrje+ij6O+b7qQNiCkN73XYTg8Skkok9cLeIUx+0ec 0wyndiLjZrjCI16w+sacqiuTmoqNKzd8xmB74CCsWwGcbutT6eHwx1RVGyAfFF5paU4P nOTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=t5faDJt0YXNHD+EUFHtfwCQsOVX8iWPJ+MGU1yXpBnw=; b=efH/efIPPJ9Jqweq9tbgipEE8p3XUmJlRVAuLPBJZmQZOtBlw/yTP7AEZTTNJ+DYDe Mbc4cn+ms+xK++R4/GOy9EPbOdir/Qdr4tAvJGt1LNGNrKhLpeSDtiM+wyzbgdpBxD4c uxQzGqZJ/6Z/DNRxOSb6rlQpz3gas5f5xrpRmeAD9ee7XpJnTtjNKVMbP3CjJ7wUqqll 24W+mtQBDb93qIJWzRjzaM+LMkSxZkYcx5SWI3KDNWSSDMJg9U4BkWnDIUVhc7wQ3A7h KLj5PvGFH5OAXs1aC+Kn1D52e0uHCxewbD7SG8q9SCcKxiDNrAkR1Ma7uLsO8LlQnyrl q1nA== X-Gm-Message-State: AOAM533Lon85qI0xFExRhv0xRXbxapyjm0oLc5gIEkg8KexQxj1R8tsx 4AEFkHDtlMl/3Hz4kuUfNnbprQwqM3Xxrw== X-Google-Smtp-Source: ABdhPJw9CQC2ER+Srj7rsAFFbzWxukvBDpIMfSAU1mQgq0cHJrbunERRPYSjAsQLTbNiVoBwRUSfBw== X-Received: by 2002:a63:1665:: with SMTP id 37mr825475pgw.383.1601053410254; Fri, 25 Sep 2020 10:03:30 -0700 (PDT) Received: from localhost.localdomain ([47.9.163.48]) by smtp.gmail.com with ESMTPSA id k27sm2822467pgm.29.2020.09.25.10.03.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Sep 2020 10:03:29 -0700 (PDT) From: shubham verma To: git@vger.kernel.org Cc: Shubham Verma Subject: [PATCH 07/11] t7001: use ': >' rather than 'touch' Date: Fri, 25 Sep 2020 22:32:52 +0530 Message-Id: <20200925170256.11490-8-shubhunic@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200925170256.11490-1-shubhunic@gmail.com> References: <20200925170256.11490-1-shubhunic@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Shubham Verma Use `>` rather than `touch` to create an empty file when the timestamp isn't relevant to the test. Signed-off-by: shubham verma --- t/t7001-mv.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index 3a3ace6d73..728a937eeb 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -47,14 +47,14 @@ test_expect_success 'checking -k on non-existing file' ' ' test_expect_success 'checking -k on untracked file' ' - touch untracked1 && + : > untracked1 && git mv -k untracked1 path0 && test -f untracked1 && test ! -f path0/untracked1 ' test_expect_success 'checking -k on multiple untracked files' ' - touch untracked2 && + : > untracked2 && git mv -k untracked1 untracked2 path0 && test -f untracked1 && test -f untracked2 && @@ -63,7 +63,7 @@ test_expect_success 'checking -k on multiple untracked files' ' ' test_expect_success 'checking -f on untracked file with existing target' ' - touch path0/untracked1 && + : > path0/untracked1 && test_must_fail git mv -f untracked1 path0 && test ! -f .git/index.lock && test -f untracked1 && @@ -482,7 +482,7 @@ test_expect_success 'moving nested submodules' ' mkdir sub_nested_nested && ( cd sub_nested_nested && - touch nested_level2 && + : > nested_level2 && git init && git add . && git commit -m "nested level 2" @@ -490,7 +490,7 @@ test_expect_success 'moving nested submodules' ' mkdir sub_nested && ( cd sub_nested && - touch nested_level1 && + : > nested_level1 && git init && git add . && git commit -m "nested level 1" && From patchwork Fri Sep 25 17:02:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubham Verma X-Patchwork-Id: 11800435 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 33B88618 for ; Fri, 25 Sep 2020 17:03:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0C26121D42 for ; Fri, 25 Sep 2020 17:03:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="upxoa41G" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729431AbgIYRDe (ORCPT ); Fri, 25 Sep 2020 13:03:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726401AbgIYRDd (ORCPT ); Fri, 25 Sep 2020 13:03:33 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94DADC0613CE for ; Fri, 25 Sep 2020 10:03:33 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id k133so3103651pgc.7 for ; Fri, 25 Sep 2020 10:03:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7L3LqwtRHDIKGcMDRkyJCjWFjBrxOj8Sqm02sjxnMX0=; b=upxoa41GhIdXKK5TXJylbNnj0nWDuLmoW5PKuhAo02/Sv30OIVzjD+xSsLCXRFTQHX VawtGr0jnSEzIs1rNbp9VYQonPNACnR9y9PLvmf0hVako9VGBTRaJco4FP0UGEweP8C3 vqAdZxGm/QFmZblO97C181jZQ2sPIWPczOUhXEcChHZ1evVWKx8F7PnyxxD2VpBfAgLX aQYTkCx7HJ6p/ctO4HWb+WQa+gM3UOD/tCkM3NXNRXDFJpqOyrvzV9qqoH3J+HKGOALT pmNOFTPRkQMBLu/q8bG0g4mJSTHoZXfrcxU7t7lBxaXJuTIp17YyRZE2w274LApJPR48 PEPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7L3LqwtRHDIKGcMDRkyJCjWFjBrxOj8Sqm02sjxnMX0=; b=WlPXk5w/onTN4OEk6LyoJRIuJh5sGKV3b2ewYCFLx8YFyDSZLYIzmp46PclVpuIS7N zPv+O4RxfEAo0sWUT+avEAATYjTInpoDLRp54vKgtJ3CuyyHrz/3GcCSFE6cbKes+OB7 iqAicn4hdgBEud/XBNFhYrAGm02wo52q9AoI9m9EYvwPME4PpX6OuDbdRnxEhOB+UnZB zZiGJBb+XE0NbtxCSwmpIHM77YKgSqMYHfds5X5xSL+ePEgJuEZnQi1VuQKhnvaWXGOp KRXY1njZ7CVt4LPxSyrnZt9z8Ec9n+ujXpdP+GSTc4SRsxTl50eiAKuU5T9A3WHFLzfH I47w== X-Gm-Message-State: AOAM531Am7MctMU7CqxIIcPoUFyNmMIkaPu+siHF+KMkvs3Y1YcXQoSi t+vL/Naz+K+hxlAhXysGrWojMGC/J50DSQ== X-Google-Smtp-Source: ABdhPJwt1YIooBbIQ8IwvV0i39d6BXeEtZLBMYMh746/AknoWk15TFG6U+k7AziXqyvWBhkTiSfc6A== X-Received: by 2002:aa7:9730:0:b029:13e:d13d:a091 with SMTP id k16-20020aa797300000b029013ed13da091mr220763pfg.40.1601053412782; Fri, 25 Sep 2020 10:03:32 -0700 (PDT) Received: from localhost.localdomain ([47.9.163.48]) by smtp.gmail.com with ESMTPSA id k27sm2822467pgm.29.2020.09.25.10.03.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Sep 2020 10:03:32 -0700 (PDT) From: shubham verma To: git@vger.kernel.org Cc: Shubham Verma Subject: [PATCH 08/11] t7001: put each command on a separate line Date: Fri, 25 Sep 2020 22:32:53 +0530 Message-Id: <20200925170256.11490-9-shubhunic@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200925170256.11490-1-shubhunic@gmail.com> References: <20200925170256.11490-1-shubhunic@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Shubham Verma Multiple commands on one line should be split across multiple lines. Signed-off-by: shubham verma --- t/t7001-mv.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index 728a937eeb..94c5b10f8a 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -143,7 +143,9 @@ test_expect_success 'checking the commit' ' ' test_expect_success 'do not move directory over existing directory' ' - mkdir path0 && mkdir path0/path2 && test_must_fail git mv path2 path0 + mkdir path0 && + mkdir path0/path2 && + test_must_fail git mv path2 path0 ' test_expect_success 'move into "."' ' From patchwork Fri Sep 25 17:02:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubham Verma X-Patchwork-Id: 11800437 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C842A618 for ; Fri, 25 Sep 2020 17:03:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A31A520936 for ; Fri, 25 Sep 2020 17:03:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DBHKNf1v" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729528AbgIYRDg (ORCPT ); Fri, 25 Sep 2020 13:03:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726401AbgIYRDg (ORCPT ); Fri, 25 Sep 2020 13:03:36 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8025BC0613CE for ; Fri, 25 Sep 2020 10:03:36 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id m34so3101210pgl.9 for ; Fri, 25 Sep 2020 10:03:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rZPRjnG2HhpL+Aoyj6iVFR0o0kEbQEV9uOPnjxjKf6I=; b=DBHKNf1vcdD2RTtCNZVtL6nT9+HEMbaUvWCTEjv0OS1XhVbAKvv0Yk4gxwqbr84dfV osQ0tZC5pkKeNpcH/KCeoJNER810Hrfc8diEnDPi8BXIMwJnSPbF6or8eoX3DanEDrsm AQsnccYmP4AiD1Jf+lwbOU5i5DFSVYiskmIlzoWtobcrVSZBnFELSlHBjISht3ZAgEmi kxw618EltzEZ2UaiznwGJux0zqMb35N7YSdIOAOe9blqSkxs2UJd78TrzMvp0b7+tWzI lqp8l7CTuhSgfUWZIeBkIJdAEFLzvWnrwKKNmBye/OzWULayzBwtZ/UqZIRhKI94Or3I 4lJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rZPRjnG2HhpL+Aoyj6iVFR0o0kEbQEV9uOPnjxjKf6I=; b=c37S1zijAMcTTwShQQs4looY3mCy2n9ODfxbDq5mGNtKJwmZ7CYvfZtFneymu7tDx4 f6UjKMPUgW7/h8OPdqBSOqXSGIebLZXdEClabZA2jMbGEQbvPhpQyb/yLXS5RNHruw1A 0W/FeW+4Tnlm87PtI1Xb8mTFYIh3tG9kb33xeLKlYu9uSSzKH00NtrjbLDiWdECBXMvc BdSKzXWfO35j82Zquymr8JpaLWG3EfPySeG4pvKinaCHpnn/bbimfJqAaw7zB9rBFbaG AyFU3B6KupuBwkN5rZwFaxv/EPZ+DtFXlcktbt/pak50FvF1r3NgJz++WajTsi5lDeFV WrqQ== X-Gm-Message-State: AOAM532P+hUv1L6NktHjOvZlJMT+UCQmFnN/k+nRDmNARHn/BA/KKvq/ lkWj6xWhFc7iSrMvMFEFPz7lkICzoGkZUQ== X-Google-Smtp-Source: ABdhPJyT7/SLDClMaO/NkOu+sr1mz3iqF9EF+Fm3BvRm7D79AJ2hi4CT598jh1LdGhMmnxjehHYMdw== X-Received: by 2002:a17:902:8305:b029:d1:cbfc:79b7 with SMTP id bd5-20020a1709028305b02900d1cbfc79b7mr339318plb.33.1601053415744; Fri, 25 Sep 2020 10:03:35 -0700 (PDT) Received: from localhost.localdomain ([47.9.163.48]) by smtp.gmail.com with ESMTPSA id k27sm2822467pgm.29.2020.09.25.10.03.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Sep 2020 10:03:34 -0700 (PDT) From: shubham verma To: git@vger.kernel.org Cc: Shubham Verma Subject: [PATCH 09/11] t7001: use here-docs instead of echo Date: Fri, 25 Sep 2020 22:32:54 +0530 Message-Id: <20200925170256.11490-10-shubhunic@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200925170256.11490-1-shubhunic@gmail.com> References: <20200925170256.11490-1-shubhunic@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Shubham Verma Change from old style to current style by taking advantage of here-docs instead of echo commands. Signed-off-by: shubham verma --- t/t7001-mv.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index 94c5b10f8a..30714a8200 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -222,7 +222,10 @@ test_expect_success 'git mv to move multiple sources into a directory' ' git add dir/?.txt && git mv dir/a.txt dir/b.txt other && git ls-files >actual && - { echo other/a.txt; echo other/b.txt; } >expect && + cat >expect <<-\EOF && + other/a.txt + other/b.txt + EOF test_cmp expect actual ' From patchwork Fri Sep 25 17:02:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubham Verma X-Patchwork-Id: 11800439 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7F8E36CA for ; Fri, 25 Sep 2020 17:03:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5FA1520936 for ; Fri, 25 Sep 2020 17:03:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HlUNImOk" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729553AbgIYRDj (ORCPT ); Fri, 25 Sep 2020 13:03:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726401AbgIYRDj (ORCPT ); Fri, 25 Sep 2020 13:03:39 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 374A2C0613CE for ; Fri, 25 Sep 2020 10:03:39 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id d9so3778350pfd.3 for ; Fri, 25 Sep 2020 10:03:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WYXuXMUjnhpaXIhYGz0f9JkrG27ddz5CLizov1s0QdY=; b=HlUNImOkCxR+KzU2QW9qW6rNblqeavxXBAyft0vD6Z+hVD2tlb+qrCkgllTdenpeTa Pi+558yCaub97Kf4Gjbj9PAGEpRNPdOLCdav2RaL4xh9S0iavXwc3nqOIWCgSZh/iRzc oTjVCVc49GxIp6YHI6bHPnXgyRd4QPLELM+AqXNCZieF1iG1TlZfmKqtOyDPwNK+x1DR +weD7lyqtYDm7WbZyYuVQxoWvI28sHuP0L8poSRxX8yU7lkz2jmWBOsCIv42mfFGHfC8 hGki0Myeqno8FUPe1TmljS92CJQARuQXwZxGH6kiX8pUCgM8r14KflA/w9hr7fw4N5FJ KovQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WYXuXMUjnhpaXIhYGz0f9JkrG27ddz5CLizov1s0QdY=; b=ALXAqFi8ADs2ac5ZyW+swpwGncD3kfuu+ZScwctPcPKDoOLufRuJn8RgyTZ/gY/Fyv sNbx5tTMPxbrpvZ+2fG56NMUI9sI70XjThzmBMh9RJAPOf2dGJ5+Sq9lRB+nV8NdILF2 IBVb5Rx+ypGB3oeYfG7gqVpP68wyZSU6lx+hMThaFAp6twxbBEjLumn/ZbLThqlMdDQW v7JpWOVWQJndeaGlmSnSXvb4kfVnoKDe1C+aPaxMnB+7sKwW1Yu9ij36ccnpRo9WY3Jp YMXQXfpwJuM4NVR3RNkHSVkcwRSbpx2IoQ/9MPdxZQKlYxHQ0+9OyrnbtPQYebW56eHI x7Vw== X-Gm-Message-State: AOAM533d2aDFHGwf2HkSZj3wWdekn9Uok2W+mYZ4hpba1/x21zTNqY8U Z8pH6EBjR7fjguDx1LjD4P/hrpnThoMvpA== X-Google-Smtp-Source: ABdhPJwxs+L1ZoKc47vHQlqzampkUvrZ9XqrmCgQV20eco4PasMGAv8+jCRMuTlLvJAaI2p58ZQf/Q== X-Received: by 2002:a62:1dc1:0:b029:13e:d13d:a051 with SMTP id d184-20020a621dc10000b029013ed13da051mr193854pfd.23.1601053418321; Fri, 25 Sep 2020 10:03:38 -0700 (PDT) Received: from localhost.localdomain ([47.9.163.48]) by smtp.gmail.com with ESMTPSA id k27sm2822467pgm.29.2020.09.25.10.03.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Sep 2020 10:03:37 -0700 (PDT) From: shubham verma To: git@vger.kernel.org Cc: Shubham Verma Subject: [PATCH 10/11] t7001: use `test` rather than `[` Date: Fri, 25 Sep 2020 22:32:55 +0530 Message-Id: <20200925170256.11490-11-shubhunic@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200925170256.11490-1-shubhunic@gmail.com> References: <20200925170256.11490-1-shubhunic@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Shubham Verma According to Documentation/CodingGuidelines, we should use "test" rather than "[ ... ]" in shell scripts, so let's replace the "[ ... ]" with "test" in the t7001 test script. Signed-off-by: shubham verma --- t/t7001-mv.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index 30714a8200..7bb4a7b759 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -236,10 +236,10 @@ test_expect_success 'git mv should not change sha1 of moved cache entry' ' git add dirty && entry="$(git ls-files --stage dirty | cut -f 1)" && git mv dirty dirty2 && - [ "$entry" = "$(git ls-files --stage dirty2 | cut -f 1)" ] && + test "$entry" = "$(git ls-files --stage dirty2 | cut -f 1)" && echo 2 >dirty2 && git mv dirty2 dirty && - [ "$entry" = "$(git ls-files --stage dirty | cut -f 1)" ] + test "$entry" = "$(git ls-files --stage dirty | cut -f 1)" ' rm -f dirty dirty2 @@ -326,7 +326,7 @@ test_expect_success 'git mv moves a submodule with a .git directory and no .gitm mkdir mod && git mv sub mod/sub && ! test -e sub && - [ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] && + test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" && git -C mod/sub status && git update-index --refresh && git diff-files --quiet @@ -346,7 +346,7 @@ test_expect_success 'git mv moves a submodule with a .git directory and .gitmodu mkdir mod && git mv sub mod/sub && ! test -e sub && - [ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] && + test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" && git -C mod/sub status && echo mod/sub >expected && git config -f .gitmodules submodule.sub.path >actual && @@ -363,7 +363,7 @@ test_expect_success 'git mv moves a submodule with gitfile' ' mkdir mod && git -C mod mv ../sub/ . && ! test -e sub && - [ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] && + test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" && git -C mod/sub status && echo mod/sub >expected && git config -f .gitmodules submodule.sub.path >actual && @@ -382,7 +382,7 @@ test_expect_success 'mv does not complain when no .gitmodules file is found' ' git mv sub mod/sub 2>actual.err && test_must_be_empty actual.err && ! test -e sub && - [ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] && + test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" && git -C mod/sub status && git update-index --refresh && git diff-files --quiet @@ -403,7 +403,7 @@ test_expect_success 'mv will error out on a modified .gitmodules file unless sta git mv sub mod/sub 2>actual.err && test_must_be_empty actual.err && ! test -e sub && - [ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] && + test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" && git -C mod/sub status && git update-index --refresh && git diff-files --quiet @@ -421,7 +421,7 @@ test_expect_success 'mv issues a warning when section is not found in .gitmodule git mv sub mod/sub 2>actual.err && test_i18ncmp expect.err actual.err && ! test -e sub && - [ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] && + test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" && git -C mod/sub status && git update-index --refresh && git diff-files --quiet From patchwork Fri Sep 25 17:02:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubham Verma X-Patchwork-Id: 11800441 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5323C618 for ; Fri, 25 Sep 2020 17:03:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2BC5821D42 for ; Fri, 25 Sep 2020 17:03:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aNr3Frso" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729562AbgIYRDm (ORCPT ); Fri, 25 Sep 2020 13:03:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726401AbgIYRDm (ORCPT ); Fri, 25 Sep 2020 13:03:42 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5DDEC0613CE for ; Fri, 25 Sep 2020 10:03:41 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id m34so3101406pgl.9 for ; Fri, 25 Sep 2020 10:03:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=74tX/V/gfV+ZWhejhVVX4fvY5oR8pC9ModxDyQKKGv0=; b=aNr3Frso0vbwMZOtsn/T903f2khDZLfZlb1j++8JJLu8DVkzfqikiATwjIrwTXr8QG NffKv1UD7RTzaVKQmVdarbwSf4obYPkG+Im0LOSBN0xvldYrnw71S32u90QXfZlgC1CC Dx+n+fvx4toX/YAUuj22F3zJUj4ZDfTifMf2tJtV2TDPbNPcBIvfd768Vpe295C5CWlQ 5ULFVi1Bg9tR6whsd5Bf6l6Ref8SIQDZI8oxaTqhfP/nkqs2YhrAaBVtaVzuT6v+rcl6 n4pm8dj8b9rbrw1+fRDb6Qznj6Ww6GCbeeFrbQfaeId4pEXaMEK70kq3QzOEtKe6C969 B6DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=74tX/V/gfV+ZWhejhVVX4fvY5oR8pC9ModxDyQKKGv0=; b=GHdZ/3S9e71DKIT/QFm3yoGjk7+/qSMbpK6DTr9OWofYq2Zhb+lAbNDI/DU14rwX3V pGEQONEQIKiqCQTpNAsC/1HLeAhEi6PiiItCemIEACf2wRcQ+D74zHUUj3V7l3zaN+DC CStK9AuAFo0tdq5RKanri97JHoU7ZJ73LmaBSn/+4BynzzOav4jb8OwxbUrlxuHwmeuD LbqnzR/DgNa1DKBztPxspyJ1vYGW59uDLt3hYHgE7FotSVCU7jHCMhr7+/HqkjTO+w4F f+decV6Xd01JIT20T7kUR1WVRcHgR2GMjDAn4AF7WrOfH7Hods5xkjhtmuvs3s7z8MI2 IhWg== X-Gm-Message-State: AOAM530/W+TdHOlL6PdtsAvk2Qvbh8LWHtwEYCGBwk7Zc0FGMcnQhRYD NlEogNWLXybrKkG0AF1utQ1qla5UbsGnug== X-Google-Smtp-Source: ABdhPJwV+uVpgH0xc9KV3hy2wj5FBEGnwz/go9zxAGppJyG7A4BedAZsVXQ2T36ZejmIhvshVNCRFA== X-Received: by 2002:a62:7c43:0:b029:139:858b:8033 with SMTP id x64-20020a627c430000b0290139858b8033mr292413pfc.3.1601053420925; Fri, 25 Sep 2020 10:03:40 -0700 (PDT) Received: from localhost.localdomain ([47.9.163.48]) by smtp.gmail.com with ESMTPSA id k27sm2822467pgm.29.2020.09.25.10.03.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Sep 2020 10:03:40 -0700 (PDT) From: shubham verma To: git@vger.kernel.org Cc: Shubham Verma Subject: [PATCH 11/11] t7001: move cleanup code from outside the tests into them Date: Fri, 25 Sep 2020 22:32:56 +0530 Message-Id: <20200925170256.11490-12-shubhunic@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200925170256.11490-1-shubhunic@gmail.com> References: <20200925170256.11490-1-shubhunic@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Shubham Verma Let's use test_when_finished() to include cleanup code inside the tests, as it's cleaner and safer to not have any code outside the tests. Signed-off-by: shubham verma --- t/t7001-mv.sh | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index 7bb4a7b759..b4d04ceaf8 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -32,6 +32,7 @@ test_expect_success 'commiting the change' ' ' test_expect_success 'checking the commit' ' + test_when_finished "rmdir path1" && git diff-tree -r -M --name-status HEAD^ HEAD >actual && grep "^R100..*path1/COPYING..*path0/COPYING" actual ' @@ -43,6 +44,7 @@ test_expect_success 'mv --dry-run does not move file' ' ' test_expect_success 'checking -k on non-existing file' ' + test_when_finished "rm -f idontexist path0/idontexist" && git mv -k idontexist path0 ' @@ -55,6 +57,7 @@ test_expect_success 'checking -k on untracked file' ' test_expect_success 'checking -k on multiple untracked files' ' : > untracked2 && + test_when_finished "rm -f untracked2 path0/untracked2" && git mv -k untracked1 untracked2 path0 && test -f untracked1 && test -f untracked2 && @@ -64,18 +67,14 @@ test_expect_success 'checking -k on multiple untracked files' ' test_expect_success 'checking -f on untracked file with existing target' ' : > path0/untracked1 && + test_when_finished "rm -f untracked1 path0/untracked1" && + test_when_finished "rm -f .git/index.lock" && test_must_fail git mv -f untracked1 path0 && test ! -f .git/index.lock && test -f untracked1 && test -f path0/untracked1 ' -# clean up the mess in case bad things happen -rm -f idontexist untracked1 untracked2 \ - path0/idontexist path0/untracked1 path0/untracked2 \ - .git/index.lock -rmdir path1 - test_expect_success 'moving to absent target with trailing slash' ' test_must_fail git mv path0/COPYING no-such-dir/ && test_must_fail git mv path0/COPYING no-such-dir// && @@ -149,10 +148,12 @@ test_expect_success 'do not move directory over existing directory' ' ' test_expect_success 'move into "."' ' + test_when_finished "rm -fr path?" && git mv path1/path2/ . ' test_expect_success "Michael Cassar's test case" ' + test_when_finished "rm -fr papers partA" && rm -fr .git papers partA && git init && mkdir -p papers/unsorted papers/all-papers partA && @@ -168,8 +169,6 @@ test_expect_success "Michael Cassar's test case" ' git ls-tree -r $T | verbose grep partA/outline.txt ' -rm -fr papers partA path? - test_expect_success "Sergey Vlasov's test case" ' rm -fr .git && git init && @@ -230,6 +229,7 @@ test_expect_success 'git mv to move multiple sources into a directory' ' ' test_expect_success 'git mv should not change sha1 of moved cache entry' ' + test_when_finished "rm -f dirty dirty2" && rm -fr .git && git init && echo 1 >dirty && @@ -242,8 +242,6 @@ test_expect_success 'git mv should not change sha1 of moved cache entry' ' test "$entry" = "$(git ls-files --stage dirty | cut -f 1)" ' -rm -f dirty dirty2 - # NB: This test is about the error message # as well as the failure. test_expect_success 'git mv error on conflicted file' ' @@ -262,6 +260,7 @@ test_expect_success 'git mv error on conflicted file' ' ' test_expect_success 'git mv should overwrite symlink to a file' ' + test_when_finished "rm -f moved symlink" && rm -fr .git && git init && echo 1 >moved && @@ -276,9 +275,8 @@ test_expect_success 'git mv should overwrite symlink to a file' ' git diff-files --quiet ' -rm -f moved symlink - test_expect_success 'git mv should overwrite file with a symlink' ' + test_when_finished "rm -f symlink" && rm -fr .git && git init && echo 1 >moved && @@ -292,11 +290,10 @@ test_expect_success 'git mv should overwrite file with a symlink' ' ' test_expect_success SYMLINKS 'check moved symlink' ' + test_when_finished "rm -f moved" && test -h moved ' -rm -f moved symlink - test_expect_success 'setup submodule' ' git commit -m initial && git reset --hard &&