git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 3/6] git-check-attr: Demonstrate problems with relative paths

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
Aug 4, 2011, 04:47 UTC
Message-ID
<1312433268-11385-4-git-send-email-mhagger@alum.mit.edu>
In-Reply-To
<1312433268-11385-1-git-send-email-mhagger@alum.mit.edu>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
---
 t/t0003-attributes.sh |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh
index 43957ea..f6cf77d 100755
--- a/t/t0003-attributes.sh
+++ b/t/t0003-attributes.sh
@@ -19,7 +19,7 @@ attr_check () {
 
 test_expect_success 'setup' '
 
-	mkdir -p a/b/d a/c &&
+	mkdir -p a/b/d a/c b &&
 	(
 		echo "[attr]notest !test"
 		echo "f	test=f"
@@ -102,6 +102,19 @@ test_expect_failure 'unnormalized paths' '
 
 '
 
+test_expect_failure 'relative paths' '
+
+	(cd a && attr_check ../f f) &&
+	(cd a && attr_check f f) &&
+	(cd a && attr_check i a/i) &&
+	(cd a && attr_check g a/g) &&
+	(cd a && attr_check b/g a/b/g) &&
+	(cd b && attr_check ../a/f f) &&
+	(cd b && attr_check ../a/g a/g) &&
+	(cd b && attr_check ../a/b/g a/b/g)
+
+'
+
 test_expect_success 'core.attributesfile' '
 	attr_check global unspecified &&
 	git config core.attributesfile "$HOME/global-gitattributes" &&
-- 
1.7.6.8.gd2879
Previous: Michael HaggertyNext: Michael Haggerty
Message 4 of 7 in “git-check-attr should work for relative paths”
  1. 0/6 git-check-attr should work for relative pathsMichael Haggerty, Aug 4, 2011
  2. 1/6 git-check-attr: test that no output is written to stderrMichael Haggerty, Aug 4, 2011
  3. 2/6 git-check-attr: Demonstrate problems with unnormalized pathsMichael Haggerty, Aug 4, 2011
  4. 3/6 git-check-attr: Demonstrate problems with relative pathsMichael Haggerty, Aug 4, 2011
  5. 4/6 git-check-attr: Normalize pathsMichael Haggerty, Aug 4, 2011
  6. 5/6 test-path-utils: Add subcommand "absolute_path"Michael Haggerty, Aug 4, 2011
  7. 6/6 test-path-utils: Add subcommand "prefix_path"Michael Haggerty, Aug 4, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.