Merge branch 'maint'
* maint: t3101: modernise style compat/nedmalloc: don't force NDEBUG on the rest of git Conflicts: Makefile
This commit is contained in:
7
Makefile
7
Makefile
@ -1465,7 +1465,7 @@ ifdef NO_REGEX
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef USE_NED_ALLOCATOR
|
ifdef USE_NED_ALLOCATOR
|
||||||
COMPAT_CFLAGS += -DUSE_NED_ALLOCATOR -DOVERRIDE_STRDUP -DNDEBUG -DREPLACE_SYSTEM_ALLOCATOR -Icompat/nedmalloc
|
COMPAT_CFLAGS += -Icompat/nedmalloc
|
||||||
COMPAT_OBJS += compat/nedmalloc/nedmalloc.o
|
COMPAT_OBJS += compat/nedmalloc/nedmalloc.o
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -1908,6 +1908,11 @@ ifdef NO_REGEX
|
|||||||
compat/regex/regex.o: EXTRA_CPPFLAGS = -DGAWK -DNO_MBSUPPORT
|
compat/regex/regex.o: EXTRA_CPPFLAGS = -DGAWK -DNO_MBSUPPORT
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifdef USE_NED_ALLOCATOR
|
||||||
|
compat/nedmalloc/nedmalloc.o: EXTRA_CPPFLAGS = \
|
||||||
|
-DNDEBUG -DOVERRIDE_STRDUP -DREPLACE_SYSTEM_ALLOCATOR
|
||||||
|
endif
|
||||||
|
|
||||||
git-%$X: %.o $(GITLIBS)
|
git-%$X: %.o $(GITLIBS)
|
||||||
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
|
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
|
||||||
|
|
||||||
|
@ -21,9 +21,8 @@ entries. Also test odd filename and missing entries handling.
|
|||||||
'
|
'
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success \
|
test_expect_success 'setup' '
|
||||||
'setup' \
|
echo 111 >1.txt &&
|
||||||
'echo 111 >1.txt &&
|
|
||||||
echo 222 >2.txt &&
|
echo 222 >2.txt &&
|
||||||
mkdir path0 path0/a path0/a/b path0/a/b/c &&
|
mkdir path0 path0/a path0/a/b path0/a/b/c &&
|
||||||
echo 111 >path0/a/b/c/1.txt &&
|
echo 111 >path0/a/b/c/1.txt &&
|
||||||
@ -37,16 +36,16 @@ test_expect_success \
|
|||||||
find *.txt path* \( -type f -o -type l \) -print |
|
find *.txt path* \( -type f -o -type l \) -print |
|
||||||
xargs git update-index --add &&
|
xargs git update-index --add &&
|
||||||
tree=`git write-tree` &&
|
tree=`git write-tree` &&
|
||||||
echo $tree'
|
echo $tree
|
||||||
|
'
|
||||||
|
|
||||||
test_output () {
|
test_output () {
|
||||||
sed -e "s/ $_x40 / X /" <current >check
|
sed -e "s/ $_x40 / X /" <current >check &&
|
||||||
test_cmp expected check
|
test_cmp expected check
|
||||||
}
|
}
|
||||||
|
|
||||||
test_expect_success \
|
test_expect_success 'ls-tree plain' '
|
||||||
'ls-tree plain' \
|
git ls-tree $tree >current &&
|
||||||
'git ls-tree $tree >current &&
|
|
||||||
cat >expected <<\EOF &&
|
cat >expected <<\EOF &&
|
||||||
100644 blob X 1.txt
|
100644 blob X 1.txt
|
||||||
100644 blob X 2.txt
|
100644 blob X 2.txt
|
||||||
@ -55,12 +54,12 @@ test_expect_success \
|
|||||||
040000 tree X path2
|
040000 tree X path2
|
||||||
040000 tree X path3
|
040000 tree X path3
|
||||||
EOF
|
EOF
|
||||||
test_output'
|
test_output
|
||||||
|
'
|
||||||
|
|
||||||
# Recursive does not show tree nodes anymore...
|
# Recursive does not show tree nodes anymore...
|
||||||
test_expect_success \
|
test_expect_success 'ls-tree recursive' '
|
||||||
'ls-tree recursive' \
|
git ls-tree -r $tree >current &&
|
||||||
'git ls-tree -r $tree >current &&
|
|
||||||
cat >expected <<\EOF &&
|
cat >expected <<\EOF &&
|
||||||
100644 blob X 1.txt
|
100644 blob X 1.txt
|
||||||
100644 blob X 2.txt
|
100644 blob X 2.txt
|
||||||
@ -70,27 +69,28 @@ test_expect_success \
|
|||||||
100644 blob X path3/1.txt
|
100644 blob X path3/1.txt
|
||||||
100644 blob X path3/2.txt
|
100644 blob X path3/2.txt
|
||||||
EOF
|
EOF
|
||||||
test_output'
|
test_output
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success \
|
test_expect_success 'ls-tree filter 1.txt' '
|
||||||
'ls-tree filter 1.txt' \
|
git ls-tree $tree 1.txt >current &&
|
||||||
'git ls-tree $tree 1.txt >current &&
|
|
||||||
cat >expected <<\EOF &&
|
cat >expected <<\EOF &&
|
||||||
100644 blob X 1.txt
|
100644 blob X 1.txt
|
||||||
EOF
|
EOF
|
||||||
test_output'
|
test_output
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success \
|
test_expect_success 'ls-tree filter path1/b/c/1.txt' '
|
||||||
'ls-tree filter path1/b/c/1.txt' \
|
git ls-tree $tree path1/b/c/1.txt >current &&
|
||||||
'git ls-tree $tree path1/b/c/1.txt >current &&
|
|
||||||
cat >expected <<\EOF &&
|
cat >expected <<\EOF &&
|
||||||
100644 blob X path1/b/c/1.txt
|
100644 blob X path1/b/c/1.txt
|
||||||
EOF
|
EOF
|
||||||
test_output'
|
test_output
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success \
|
test_expect_success 'ls-tree filter all 1.txt files' '
|
||||||
'ls-tree filter all 1.txt files' \
|
git ls-tree $tree 1.txt path0/a/b/c/1.txt \
|
||||||
'git ls-tree $tree 1.txt path0/a/b/c/1.txt path1/b/c/1.txt path2/1.txt path3/1.txt >current &&
|
path1/b/c/1.txt path2/1.txt path3/1.txt >current &&
|
||||||
cat >expected <<\EOF &&
|
cat >expected <<\EOF &&
|
||||||
100644 blob X 1.txt
|
100644 blob X 1.txt
|
||||||
100644 blob X path0/a/b/c/1.txt
|
100644 blob X path0/a/b/c/1.txt
|
||||||
@ -98,40 +98,42 @@ test_expect_success \
|
|||||||
100644 blob X path2/1.txt
|
100644 blob X path2/1.txt
|
||||||
100644 blob X path3/1.txt
|
100644 blob X path3/1.txt
|
||||||
EOF
|
EOF
|
||||||
test_output'
|
test_output
|
||||||
|
'
|
||||||
|
|
||||||
# I am not so sure about this one after ls-tree doing pathspec match.
|
# I am not so sure about this one after ls-tree doing pathspec match.
|
||||||
# Having both path0/a and path0/a/b/c makes path0/a redundant, and
|
# Having both path0/a and path0/a/b/c makes path0/a redundant, and
|
||||||
# it behaves as if path0/a/b/c, path1/b/c, path2 and path3 are specified.
|
# it behaves as if path0/a/b/c, path1/b/c, path2 and path3 are specified.
|
||||||
test_expect_success \
|
test_expect_success 'ls-tree filter directories' '
|
||||||
'ls-tree filter directories' \
|
git ls-tree $tree path3 path2 path0/a/b/c path1/b/c path0/a >current &&
|
||||||
'git ls-tree $tree path3 path2 path0/a/b/c path1/b/c path0/a >current &&
|
|
||||||
cat >expected <<\EOF &&
|
cat >expected <<\EOF &&
|
||||||
040000 tree X path0/a/b/c
|
040000 tree X path0/a/b/c
|
||||||
040000 tree X path1/b/c
|
040000 tree X path1/b/c
|
||||||
040000 tree X path2
|
040000 tree X path2
|
||||||
040000 tree X path3
|
040000 tree X path3
|
||||||
EOF
|
EOF
|
||||||
test_output'
|
test_output
|
||||||
|
'
|
||||||
|
|
||||||
# Again, duplicates are filtered away so this is equivalent to
|
# Again, duplicates are filtered away so this is equivalent to
|
||||||
# having 1.txt and path3
|
# having 1.txt and path3
|
||||||
test_expect_success \
|
test_expect_success 'ls-tree filter odd names' '
|
||||||
'ls-tree filter odd names' \
|
git ls-tree $tree 1.txt ./1.txt .//1.txt \
|
||||||
'git ls-tree $tree 1.txt ./1.txt .//1.txt path3/1.txt path3/./1.txt path3 path3// >current &&
|
path3/1.txt path3/./1.txt path3 path3// >current &&
|
||||||
cat >expected <<\EOF &&
|
cat >expected <<\EOF &&
|
||||||
100644 blob X 1.txt
|
100644 blob X 1.txt
|
||||||
100644 blob X path3/1.txt
|
100644 blob X path3/1.txt
|
||||||
100644 blob X path3/2.txt
|
100644 blob X path3/2.txt
|
||||||
EOF
|
EOF
|
||||||
test_output'
|
test_output
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success \
|
test_expect_success 'ls-tree filter missing files and extra slashes' '
|
||||||
'ls-tree filter missing files and extra slashes' \
|
git ls-tree $tree 1.txt/ abc.txt \
|
||||||
'git ls-tree $tree 1.txt/ abc.txt path3//23.txt path3/2.txt/// >current &&
|
path3//23.txt path3/2.txt/// >current &&
|
||||||
cat >expected <<\EOF &&
|
>expected &&
|
||||||
EOF
|
test_output
|
||||||
test_output'
|
'
|
||||||
|
|
||||||
test_expect_success 'ls-tree filter is leading path match' '
|
test_expect_success 'ls-tree filter is leading path match' '
|
||||||
git ls-tree $tree pa path3/a >current &&
|
git ls-tree $tree pa path3/a >current &&
|
||||||
@ -198,7 +200,7 @@ EOF
|
|||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'ls-tree --name-only' '
|
test_expect_success 'ls-tree --name-only' '
|
||||||
git ls-tree --name-only $tree >current
|
git ls-tree --name-only $tree >current &&
|
||||||
cat >expected <<\EOF &&
|
cat >expected <<\EOF &&
|
||||||
1.txt
|
1.txt
|
||||||
2.txt
|
2.txt
|
||||||
@ -211,7 +213,7 @@ EOF
|
|||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'ls-tree --name-only -r' '
|
test_expect_success 'ls-tree --name-only -r' '
|
||||||
git ls-tree --name-only -r $tree >current
|
git ls-tree --name-only -r $tree >current &&
|
||||||
cat >expected <<\EOF &&
|
cat >expected <<\EOF &&
|
||||||
1.txt
|
1.txt
|
||||||
2.txt
|
2.txt
|
||||||
|
Reference in New Issue
Block a user