From: Brad King <brad.king@kitware.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com
Subject: [PATCH 2/2] submodule: Tolerate auto/safecrlf when adding .gitmodules
Date: Wed, 20 Jun 2012 10:43:33 -0400 [thread overview]
Message-ID: <eebc8b3692f8fcb95cf75278f7c9f9982e8f2cd6.1340202515.git.brad.king@kitware.com> (raw)
In-Reply-To: <cover.1340202515.git.brad.king@kitware.com>
Temporarily disable 'core.safecrlf' to add '.gitmodules' so that
'git add' does not reject the LF newlines we write to the file
even if both 'core.autocrlf' and 'core.safecrlf' are enabled.
This fixes known breakage tested in t7400-submodule-basic.
Signed-off-by: Brad King <brad.king@kitware.com>
---
git-submodule.sh | 2 +-
t/t7400-submodule-basic.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/git-submodule.sh b/git-submodule.sh
index 5c61ae2..ed9a54a 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -303,7 +303,7 @@ Use -f if you really want to add it." >&2
git config -f .gitmodules submodule."$sm_path".path "$sm_path" &&
git config -f .gitmodules submodule."$sm_path".url "$repo" &&
- git add --force .gitmodules ||
+ git -c core.safecrlf=false add --force .gitmodules ||
die "$(eval_gettext "Failed to register submodule '\$sm_path'")"
}
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index 5eaeb04..9a4da9b 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -99,7 +99,7 @@ test_expect_success 'submodule add' '
test_cmp empty untracked
'
-test_expect_failure 'submodule add with core.autocrlf and core.safecrlf' '
+test_expect_success 'submodule add with core.autocrlf and core.safecrlf' '
(
cd addtest-crlf &&
git config core.autocrlf true &&
--
1.7.10
next prev parent reply other threads:[~2012-06-20 14:53 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-20 14:43 [PATCH 0/2] submodule add + autocrlf + safecrlf Brad King
2012-06-20 14:43 ` [PATCH 1/2] submodule: Demonstrate failure to add with auto/safecrlf Brad King
2012-06-20 14:43 ` Brad King [this message]
2012-06-20 17:52 ` [PATCH 2/2] submodule: Tolerate auto/safecrlf when adding .gitmodules Jens Lehmann
2012-06-20 18:06 ` Brad King
2012-06-20 18:21 ` Jens Lehmann
2012-06-20 19:11 ` Jeff King
2012-06-20 19:53 ` Junio C Hamano
2012-06-21 19:06 ` Jens Lehmann
2012-06-20 17:49 ` [PATCH 0/2] submodule add + autocrlf + safecrlf Junio C Hamano
2012-06-20 18:09 ` Brad King
2012-06-20 19:24 ` 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=eebc8b3692f8fcb95cf75278f7c9f9982e8f2cd6.1340202515.git.brad.king@kitware.com \
--to=brad.king@kitware.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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).