git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shourya Shukla <periperidip@gmail.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, Johannes.Schindelin@gmx.de,
	liu.denton@gmail.com, christian.couder@gmail.com,
	kaartic.sivaraam@gmail.com,
	Shourya Shukla <periperidip@gmail.com>
Subject: [PATCH v3 3/3] t7400: add test to check 'submodule add' for tracked paths
Date: Tue, 15 Dec 2020 04:49:39 +0530	[thread overview]
Message-ID: <20201214231939.644175-4-periperidip@gmail.com> (raw)
In-Reply-To: <20201214231939.644175-1-periperidip@gmail.com>

Add test to check if 'git submodule add' works on paths which are
tracked by Git.

Helped-by: Christian Couder <christian.couder@gmail.com>
Helped-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Signed-off-by: Shourya Shukla <periperidip@gmail.com>
---
 t/t7400-submodule-basic.sh | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index 4ab8298385..d9317192e0 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -193,6 +193,17 @@ test_expect_success 'submodule add to .gitignored path with --force' '
 	)
 '
 
+test_expect_success 'submodule add to path with tracked contents fails' '
+	(
+		cd addtest-ignore &&
+		mkdir track &&
+		git add -f track &&
+		git commit -m "add tracked path" &&
+		! git submodule add "$submodurl" submod >output 2>&1 &&
+		test_file_not_empty output
+	)
+'
+
 test_expect_success 'submodule add to reconfigure existing submodule with --force' '
 	(
 		cd addtest-ignore &&
-- 
2.25.1


  parent reply	other threads:[~2020-12-14 23:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-14 23:19 [PATCH v3 0/3] submodule: port subcommand add from shell to C Shourya Shukla
2020-12-14 23:19 ` [PATCH v3 1/3] dir: change the scope of function 'directory_exists_in_index()' Shourya Shukla
2020-12-19  0:08   ` Johannes Schindelin
2020-12-19  0:47     ` Junio C Hamano
2020-12-14 23:19 ` [PATCH v3 2/3] submodule: port submodule subcommand 'add' from shell to C Shourya Shukla
2020-12-14 23:19 ` Shourya Shukla [this message]
2020-12-15 21:44 ` [PATCH v3 0/3] submodule: port subcommand add " Junio C Hamano
2020-12-17 14:16   ` Shourya Shukla
2020-12-17 22:20     ` Junio C Hamano
2020-12-22 23:42 ` Junio C Hamano

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=20201214231939.644175-4-periperidip@gmail.com \
    --to=periperidip@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=kaartic.sivaraam@gmail.com \
    --cc=liu.denton@gmail.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).