git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kristian Amlie <kristian.amlie@nokia.com>
To: git@vger.kernel.org
Cc: Kristian Amlie <kristian.amlie@nokia.com>
Subject: [PATCH 1/2] Add a test for checking whether gitattributes is honored by checkout.
Date: Fri, 13 Mar 2009 14:24:15 +0100	[thread overview]
Message-ID: <1236950656-1967-2-git-send-email-kristian.amlie@nokia.com> (raw)
In-Reply-To: <1236950656-1967-1-git-send-email-kristian.amlie@nokia.com>

The original bug will not honor new entries in gitattributes if they
are changed in the same checkout as the files they affect.

It will also keep using .gitattributes, even if it is deleted in the
same commit as the files it affects.
---
 t/t2013-checkout-crlf.sh |   41 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 41 insertions(+), 0 deletions(-)
 create mode 100755 t/t2013-checkout-crlf.sh

diff --git a/t/t2013-checkout-crlf.sh b/t/t2013-checkout-crlf.sh
new file mode 100755
index 0000000..d9d6465
--- /dev/null
+++ b/t/t2013-checkout-crlf.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+test_description='checkout should honor .gitattributes'
+
+. ./test-lib.sh
+
+test_expect_success 'setup' '
+
+        git config core.autocrlf true &&
+        printf ".file2 -crlf\r\n" > .gitattributes &&
+        git add .gitattributes &&
+        git commit -m initial &&
+        printf ".file -crlf\n" >> .gitattributes &&
+        printf "contents\n" > .file &&
+        git add .gitattributes .file &&
+        git commit -m second &&
+        git rm .gitattributes &&
+        printf "contents\r\n" > .file2 &&
+        git add .file2 &&
+        git commit -m third
+
+'
+
+test_expect_failure 'checkout with existing .gitattributes' '
+
+        git checkout master~2 &&
+        git checkout master~1 &&
+        test "$(git diff-files --raw)" = ""
+
+'
+
+test_expect_failure 'checkout when deleting .gitattributes' '
+
+        git checkout master~1 &&
+        git checkout master &&
+        test "$(stat -c %s .file2)" = "10"
+
+'
+
+test_done
+
-- 
1.6.1.1

  reply	other threads:[~2009-03-13 13:26 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-28 15:25 Honoring a checked out gitattributes file Kristian Amlie
2009-01-28 16:44 ` Michael J Gruber
2009-01-28 17:25   ` Kristian Amlie
2009-01-30 13:00     ` Kristian Amlie
2009-01-30 13:00       ` [PATCH] Add a test for checking whether gitattributes is honored by checkout Kristian Amlie
2009-03-12  9:36       ` Honoring a checked out gitattributes file Kristian Amlie
2009-03-12  9:36         ` [PATCH 1/2] Add a test for checking whether gitattributes is honored by checkout Kristian Amlie
2009-03-12  9:36           ` [PATCH 2/2] Make Git respect changes to .gitattributes during checkout Kristian Amlie
2009-03-12  9:59             ` Johannes Sixt
2009-03-12 10:23               ` Kristian Amlie
2009-03-13 13:24               ` Honoring a checked out gitattributes file Kristian Amlie
2009-03-13 13:24                 ` Kristian Amlie [this message]
2009-03-13 13:24                   ` [PATCH 2/2] Make Git respect changes to .gitattributes during checkout Kristian Amlie
2009-03-14  4:17                     ` Junio C Hamano
2009-03-19 15:42                       ` Kristian Amlie
2009-03-19 21:06                         ` Junio C Hamano
2009-03-20  8:11                           ` Kristian Amlie
2009-03-20  9:32                             ` [PATCH] Add a test for checking whether gitattributes is honored by checkout Kristian Amlie
2009-03-14  4:36                   ` [PATCH 1/2] " Junio C Hamano
2009-03-12  9:47           ` Matthieu Moy
2009-03-12  9:53             ` Kristian Amlie
2009-01-28 17:55 ` Honoring a checked out gitattributes file Jeff King

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=1236950656-1967-2-git-send-email-kristian.amlie@nokia.com \
    --to=kristian.amlie@nokia.com \
    --cc=git@vger.kernel.org \
    /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).