Skip to content

Commit 6f10c41

Browse files
committed
Merge branch 'maint'
* maint: Documentation: document show -s dir.c: fix EXC_FLAG_MUSTBEDIR match in sparse checkout
2 parents 3089c2b + 60aa9cf commit 6f10c41

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

Documentation/git-show.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ git show v1.0.0::
5454
git show v1.0.0^\{tree\}::
5555
Shows the tree pointed to by the tag `v1.0.0`.
5656

57+
git show -s --format=%s v1.0.0^\{commit\}::
58+
Shows the subject of the commit pointed to by the
59+
tag `v1.0.0`.
60+
5761
git show next~10:Documentation/README::
5862
Shows the contents of the file `Documentation/README` as
5963
they were current in the 10th last commit of the branch

Documentation/rev-list-options.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ options may be given. See linkgit:git-diff-files[1] for more options.
146146
-t::
147147

148148
Show the tree objects in the diff output. This implies '-r'.
149+
150+
-s::
151+
Suppress diff output.
149152
endif::git-rev-list[]
150153

151154
Commit Limiting

dir.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,8 @@ int excluded_from_list(const char *pathname,
360360

361361
if (x->flags & EXC_FLAG_MUSTBEDIR) {
362362
if (!dtype) {
363-
if (!prefixcmp(pathname, exclude))
363+
if (!prefixcmp(pathname, exclude) &&
364+
pathname[x->patternlen] == '/')
364365
return to_exclude;
365366
else
366367
continue;

t/t1011-read-tree-sparse-checkout.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,19 @@ test_expect_success 'setup' '
1717
cat >expected <<-\EOF &&
1818
100644 77f0ba1734ed79d12881f81b36ee134de6a3327b 0 init.t
1919
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 sub/added
20+
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 subsub/added
2021
EOF
2122
cat >expected.swt <<-\EOF &&
2223
H init.t
2324
H sub/added
25+
H subsub/added
2426
EOF
2527
2628
test_commit init &&
2729
echo modified >>init.t &&
28-
mkdir sub &&
29-
touch sub/added &&
30-
git add init.t sub/added &&
30+
mkdir sub subsub &&
31+
touch sub/added subsub/added &&
32+
git add init.t sub/added subsub/added &&
3133
git commit -m "modified and added" &&
3234
git tag top &&
3335
git rm sub/added &&
@@ -81,6 +83,7 @@ test_expect_success 'match directories with trailing slash' '
8183
cat >expected.swt-noinit <<-\EOF &&
8284
S init.t
8385
H sub/added
86+
S subsub/added
8487
EOF
8588
8689
echo sub/ > .git/info/sparse-checkout &&
@@ -105,6 +108,7 @@ test_expect_success 'checkout area changes' '
105108
cat >expected.swt-nosub <<-\EOF &&
106109
H init.t
107110
S sub/added
111+
S subsub/added
108112
EOF
109113
110114
echo init.t >.git/info/sparse-checkout &&

0 commit comments

Comments
 (0)