summaryrefslogtreecommitdiff
path: root/t/t0003-attributes.sh
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2011-08-04 06:36:30 +0200
committerJunio C Hamano <gitster@pobox.com>2011-08-04 15:53:19 -0700
commit4ca0f188f6ece3098b60b6ba732e1e8551466f60 (patch)
tree1aa17c9a28853ac19588c1b0036c4ae27e5a9c0e /t/t0003-attributes.sh
parentfdf6be8259fc59fc251b325f66e86df0fe905e79 (diff)
downloadgit-4ca0f188f6ece3098b60b6ba732e1e8551466f60.tar.gz
git-check-attr: Add an --all option to show all attributes
Add new usage patterns git check-attr [-a | --all] [--] pathname... git check-attr --stdin [-a | --all] < <list-of-paths> which display all attributes associated with the specified file(s). Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0003-attributes.sh')
-rwxr-xr-xt/t0003-attributes.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh
index 22540051d8..8892ba3bb2 100755
--- a/t/t0003-attributes.sh
+++ b/t/t0003-attributes.sh
@@ -107,6 +107,30 @@ EOF
test_cmp expect actual
'
+test_expect_success 'attribute test: --all option' '
+
+ cat <<EOF > all &&
+f: test: f
+a/f: test: f
+a/c/f: test: f
+a/g: test: a/g
+a/b/g: test: a/b/g
+b/g: test: unspecified
+a/b/h: test: a/b/h
+a/b/d/g: test: a/b/d/*
+onoff: test: unset
+offon: test: set
+no: notest: set
+a/b/d/no: test: a/b/d/*
+a/b/d/no: notest: set
+a/b/d/yes: notest: set
+EOF
+
+ grep -v unspecified < all | sort > expect &&
+ sed -e "s/:.*//" < all | uniq | git check-attr --stdin --all | sort > actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'root subdir attribute test' '
attr_check a/i a/i &&