@@ -139,7 +139,7 @@ create_lib_submodule_repo () {
git revert HEAD &&
git checkout -b invalid_sub1 add_sub1 &&
- git update-index --cacheinfo 160000 $(test_oid numeric) sub1 &&
+ git update-index --cacheinfo 160000,$(test_oid numeric),sub1 &&
git commit -m "Invalid sub1 commit" &&
git checkout -b valid_sub1 &&
git revert HEAD &&
@@ -213,7 +213,7 @@ test_expect_success 'error if encoding round trip is not the same during refresh
echo "*.utf16le text working-tree-encoding=utf-16le" >.gitattributes &&
echo "hallo" >nonsense.utf16le &&
TEST_HASH=$(git hash-object --no-filters -w nonsense.utf16le) &&
- git update-index --add --cacheinfo 100644 $TEST_HASH nonsense.utf16le &&
+ git update-index --add --cacheinfo 100644,$TEST_HASH,nonsense.utf16le &&
COMMIT=$(git commit-tree -p $(git rev-parse HEAD) -m "plain commit" $(git write-tree)) &&
git update-ref refs/heads/master $COMMIT &&
@@ -229,7 +229,7 @@ test_expect_success 'error if encoding garbage is already in Git' '
# This simulates a Git version that has no checkoutEncoding support
cp nobom.utf16be.raw nonsense.utf16 &&
TEST_HASH=$(git hash-object --no-filters -w nonsense.utf16) &&
- git update-index --add --cacheinfo 100644 $TEST_HASH nonsense.utf16 &&
+ git update-index --add --cacheinfo 100644,$TEST_HASH,nonsense.utf16 &&
COMMIT=$(git commit-tree -p $(git rev-parse HEAD) -m "plain commit" $(git write-tree)) &&
git update-ref refs/heads/master $COMMIT &&
@@ -134,7 +134,7 @@ run_tests 'blob' $hello_sha1 $hello_size "$hello_content" "$hello_content"
test_expect_success '--batch-check without %(rest) considers whole line' '
echo "$hello_sha1 blob $hello_size" >expect &&
- git update-index --add --cacheinfo 100644 $hello_sha1 "white space" &&
+ git update-index --add --cacheinfo 100644,$hello_sha1,"white space" &&
test_when_finished "git update-index --remove \"white space\"" &&
echo ":white space" | git cat-file --batch-check >actual &&
test_cmp expect actual
@@ -23,7 +23,7 @@ test_expect_success setup '
test_tick &&
git commit -q -m one &&
H=$(git rev-parse HEAD) &&
- git update-index --add --cacheinfo 160000 $H sub &&
+ git update-index --add --cacheinfo 160000,$H,sub &&
test_tick &&
git commit -q -m two &&
git rev-parse HEAD^{tree} >tree.withsub &&
@@ -90,7 +90,7 @@ test_expect_success 'add a large file or two' '
test_expect_success 'checkout a large file' '
large1=$(git rev-parse :large1) &&
- git update-index --add --cacheinfo 100644 $large1 another &&
+ git update-index --add --cacheinfo 100644,$large1,another &&
git checkout another &&
test_cmp large1 another
'
@@ -59,7 +59,7 @@ test_expect_success 'object with bad sha1' '
sha="$(dirname $new)$(basename $new)" &&
mv .git/objects/$old .git/objects/$new &&
test_when_finished "remove_object $sha" &&
- git update-index --add --cacheinfo 100644 $sha foo &&
+ git update-index --add --cacheinfo 100644,$sha,foo &&
test_when_finished "git read-tree -u --reset HEAD" &&
tree=$(git write-tree) &&
test_when_finished "remove_object $tree" &&
@@ -438,7 +438,7 @@ test_expect_success 'rev-list --verify-objects with bad sha1' '
sha="$(dirname $new)$(basename $new)" &&
mv .git/objects/$old .git/objects/$new &&
test_when_finished "remove_object $sha" &&
- git update-index --add --cacheinfo 100644 $sha foo &&
+ git update-index --add --cacheinfo 100644,$sha,foo &&
test_when_finished "git read-tree -u --reset HEAD" &&
tree=$(git write-tree) &&
test_when_finished "remove_object $tree" &&
@@ -305,7 +305,7 @@ EOF
test_expect_success 'rm removes empty submodules from work tree' '
mkdir submod &&
hash=$(git rev-parse HEAD) &&
- git update-index --add --cacheinfo 160000 "$hash" submod &&
+ git update-index --add --cacheinfo 160000,"$hash",submod &&
git config -f .gitmodules submodule.sub.url ./. &&
git config -f .gitmodules submodule.sub.path submod &&
git submodule init &&
@@ -632,7 +632,7 @@ test_expect_success 'setup subsubmodule' '
(
cd submod &&
hash=$(git rev-parse HEAD) &&
- git update-index --add --cacheinfo 160000 "$hash" subsubmod &&
+ git update-index --add --cacheinfo 160000,"$hash",subsubmod &&
git config -f .gitmodules submodule.sub.url ../. &&
git config -f .gitmodules submodule.sub.path subsubmod &&
git submodule init &&
@@ -350,7 +350,7 @@ test_expect_success 'failed --rebase shows advice' '
git checkout -b diverging &&
test_commit attributes .gitattributes "* text=auto" attrs &&
sha1="$(printf "1\\r\\n" | git hash-object -w --stdin)" &&
- git update-index --cacheinfo 0644 $sha1 file &&
+ git update-index --cacheinfo 0644,$sha1,file &&
git commit -m v1-with-cr &&
# force checkout because `git reset --hard` will not leave clean `file`
git checkout -f -b fails-to-rebase HEAD^ &&
@@ -614,12 +614,12 @@ test_expect_success "fetch new submodule commits on-demand outside standard refs
C=$(git -C submodule commit-tree -m "new change outside refs/heads" HEAD^{tree}) &&
git -C submodule update-ref refs/changes/1 $C &&
- git update-index --cacheinfo 160000 $C submodule &&
+ git update-index --cacheinfo 160000,$C,submodule &&
test_tick &&
D=$(git -C sub1 commit-tree -m "new change outside refs/heads" HEAD^{tree}) &&
git -C sub1 update-ref refs/changes/2 $D &&
- git update-index --cacheinfo 160000 $D sub1 &&
+ git update-index --cacheinfo 160000,$D,sub1 &&
git commit -m "updated submodules outside of refs/heads" &&
E=$(git rev-parse HEAD) &&
@@ -638,12 +638,12 @@ test_expect_success 'fetch new submodule commit on-demand in FETCH_HEAD' '
C=$(git -C submodule commit-tree -m "another change outside refs/heads" HEAD^{tree}) &&
git -C submodule update-ref refs/changes/4 $C &&
- git update-index --cacheinfo 160000 $C submodule &&
+ git update-index --cacheinfo 160000,$C,submodule &&
test_tick &&
D=$(git -C sub1 commit-tree -m "another change outside refs/heads" HEAD^{tree}) &&
git -C sub1 update-ref refs/changes/5 $D &&
- git update-index --cacheinfo 160000 $D sub1 &&
+ git update-index --cacheinfo 160000,$D,sub1 &&
git commit -m "updated submodules outside of refs/heads" &&
E=$(git rev-parse HEAD) &&
@@ -669,12 +669,12 @@ test_expect_success 'fetch new submodule commits on-demand without .gitmodules e
C=$(git -C submodule commit-tree -m "yet another change outside refs/heads" HEAD^{tree}) &&
git -C submodule update-ref refs/changes/7 $C &&
- git update-index --cacheinfo 160000 $C submodule &&
+ git update-index --cacheinfo 160000,$C,submodule &&
test_tick &&
D=$(git -C sub1 commit-tree -m "yet another change outside refs/heads" HEAD^{tree}) &&
git -C sub1 update-ref refs/changes/8 $D &&
- git update-index --cacheinfo 160000 $D sub1 &&
+ git update-index --cacheinfo 160000,$D,sub1 &&
git commit -m "updated submodules outside of refs/heads" &&
E=$(git rev-parse HEAD) &&
@@ -696,15 +696,15 @@ test_expect_success 'fetch new submodule commit intermittently referenced by sup
F=$(git -C sub1 commit-tree -m "change 12 outside refs/heads" HEAD^{tree}) &&
git -C sub1 update-ref refs/changes/10 $D &&
- git update-index --cacheinfo 160000 $D sub1 &&
+ git update-index --cacheinfo 160000,$D,sub1 &&
git commit -m "updated submodules outside of refs/heads" &&
git -C sub1 update-ref refs/changes/11 $E &&
- git update-index --cacheinfo 160000 $E sub1 &&
+ git update-index --cacheinfo 160000,$E,sub1 &&
git commit -m "updated submodules outside of refs/heads" &&
git -C sub1 update-ref refs/changes/12 $F &&
- git update-index --cacheinfo 160000 $F sub1 &&
+ git update-index --cacheinfo 160000,$F,sub1 &&
git commit -m "updated submodules outside of refs/heads" &&
G=$(git rev-parse HEAD) &&
@@ -301,7 +301,7 @@ test_expect_success 'push succeeds if submodule commit disabling recursion from
test_expect_success 'submodule entry pointing at a tag is error' '
git -C work/gar/bage tag -a test1 -m "tag" &&
tag=$(git -C work/gar/bage rev-parse test1^{tag}) &&
- git -C work update-index --cacheinfo 160000 "$tag" gar/bage &&
+ git -C work update-index --cacheinfo 160000,"$tag",gar/bage &&
git -C work commit -m "bad commit" &&
test_when_finished "git -C work reset --hard HEAD^" &&
test_must_fail git -C work push --recurse-submodules=on-demand ../pub.git master 2>err &&
@@ -11,7 +11,7 @@ test_expect_success 'create commits with glob characters' '
# on Windows (the tests below do not depend on the presence
# of the file in the worktree)
git config core.protectNTFS false &&
- git update-index --add --cacheinfo 100644 "$(git rev-parse HEAD:foo)" "f*" &&
+ git update-index --add --cacheinfo 100644,"$(git rev-parse HEAD:foo)","f*" &&
test_tick &&
git commit -m star &&
test_commit bracket "f[o][o]"
@@ -246,7 +246,7 @@ test_expect_success 'setup 7' '
git rm d/e &&
test_tick &&
git commit -m "remove d/e" &&
- git update-index --add --cacheinfo 160000 $c1 d &&
+ git update-index --add --cacheinfo 160000,$c1,d &&
test_tick &&
git commit -m "make d/ a submodule"
'
@@ -467,7 +467,7 @@ test_expect_success 'replace submodule revision' '
git reset --hard original &&
git filter-branch -f --tree-filter \
"if git ls-files --error-unmatch -- submod > /dev/null 2>&1
- then git update-index --cacheinfo 160000 $invalid submod
+ then git update-index --cacheinfo 160000,$invalid,submod
fi" HEAD &&
test $orig_head != $(git show-ref --hash --head HEAD)
'
@@ -26,7 +26,7 @@ EOF
setup_absent() {
test -f 1 && rm 1
git update-index --remove 1 &&
- git update-index --add --cacheinfo 100644 $EMPTY_BLOB 1 &&
+ git update-index --add --cacheinfo 100644,$EMPTY_BLOB,1 &&
git update-index --skip-worktree 1
}
@@ -40,7 +40,7 @@ test_absent() {
setup_dirty() {
git update-index --force-remove 1 &&
echo dirty > 1 &&
- git update-index --add --cacheinfo 100644 $EMPTY_BLOB 1 &&
+ git update-index --add --cacheinfo 100644,$EMPTY_BLOB,1 &&
git update-index --skip-worktree 1
}
@@ -56,7 +56,7 @@ test_expect_success 'read-tree removes worktree, dirty case' '
setup_absent() {
test -f 1 && rm 1
git update-index --remove 1 &&
- git update-index --add --cacheinfo 100644 $EMPTY_BLOB 1 &&
+ git update-index --add --cacheinfo 100644,$EMPTY_BLOB,1 &&
git update-index --skip-worktree 1
}
@@ -70,7 +70,7 @@ test_absent() {
setup_dirty() {
git update-index --force-remove 1 &&
echo dirty > 1 &&
- git update-index --add --cacheinfo 100644 $EMPTY_BLOB 1 &&
+ git update-index --add --cacheinfo 100644,$EMPTY_BLOB,1 &&
git update-index --skip-worktree 1
}
@@ -132,7 +132,7 @@ test_expect_success 'test reset --mixed and update-index triggers the hook' '
test_path_is_file testsuccess && rm -f testsuccess &&
test_path_is_missing testfailure &&
git hash-object -w --stdin <dir1/file2.txt >expect &&
- git update-index --cacheinfo 100644 "$(cat expect)" dir1/file1.txt &&
+ git update-index --cacheinfo 100644,"$(cat expect)",dir1/file1.txt &&
test_path_is_file testsuccess && rm -f testsuccess &&
test_path_is_missing testfailure &&
git update-index --skip-worktree dir1/file2.txt &&
@@ -517,7 +517,7 @@ test_expect_success 'submodule init does not copy command into .git/config' '
git ls-files -s submodule >out &&
H=$(cut -d" " -f2 out) &&
mkdir submodule1 &&
- git update-index --add --cacheinfo 160000 $H submodule1 &&
+ git update-index --add --cacheinfo 160000,$H,submodule1 &&
git config -f .gitmodules submodule.submodule1.path submodule1 &&
git config -f .gitmodules submodule.submodule1.url ../submodule &&
git config -f .gitmodules submodule.submodule1.update !false &&
@@ -928,7 +928,7 @@ test_expect_success 'submodule update properly revives a moved submodule' '
git rm --cached submodule2 &&
rm -rf submodule2 &&
mkdir -p "moved/sub module" &&
- git update-index --add --cacheinfo 160000 $H "moved/sub module" &&
+ git update-index --add --cacheinfo 160000,$H,"moved/sub module" &&
git config -f .gitmodules submodule.submodule2.path "moved/sub module" &&
git commit -am "post move" &&
git submodule update &&
@@ -604,10 +604,10 @@ test_expect_success 'fast-export quotes pathnames' '
(cd crazy-paths &&
blob=$(echo foo | git hash-object -w --stdin) &&
git -c core.protectNTFS=false update-index --add \
- --cacheinfo 100644 $blob "$(printf "path with\\nnewline")" \
- --cacheinfo 100644 $blob "path with \"quote\"" \
- --cacheinfo 100644 $blob "path with \\backslash" \
- --cacheinfo 100644 $blob "path with space" &&
+ --cacheinfo 100644,$blob,"$(printf "path with\\nnewline")" \
+ --cacheinfo 100644,$blob,"path with \"quote\"" \
+ --cacheinfo 100644,$blob,"path with \\backslash" \
+ --cacheinfo 100644,$blob,"path with space" &&
git commit -m addition &&
git ls-files -z -s | perl -0pe "s{\\t}{$&subdir/}" >index &&
git read-tree --empty &&
@@ -1230,7 +1230,7 @@ test_ln_s_add () {
else
printf '%s' "$1" >"$2" &&
ln_s_obj=$(git hash-object -w "$2") &&
- git update-index --add --cacheinfo 120000 $ln_s_obj "$2" &&
+ git update-index --add --cacheinfo 120000,$ln_s_obj,"$2" &&
# pick up stat info from the file
git update-index "$2"
fi