diff --git a/t/t-migrate-fixup.sh b/t/t-migrate-fixup.sh index 8f027fce..32d56fa2 100755 --- a/t/t-migrate-fixup.sh +++ b/t/t-migrate-fixup.sh @@ -34,7 +34,7 @@ begin_test "migrate import (--fixup, complex nested)" git lfs migrate import --everything --fixup --yes assert_pointer "refs/heads/main" "a.txt" "$a_oid" "1" - refute_pointer "refs/heads/main" "b.txt" + refute_pointer "refs/heads/main" "dir/b.txt" assert_local_object "$a_oid" "1" refute_local_object "$b_oid" "1" diff --git a/t/testhelpers.sh b/t/testhelpers.sh index e32e32a8..7c921f43 100644 --- a/t/testhelpers.sh +++ b/t/testhelpers.sh @@ -2,6 +2,9 @@ # assert_pointer confirms that the pointer in the repository for $path in the # given $ref matches the given $oid and $size. +# Note that $path is prepended with a space to match the against the start +# of path field in the ls-tree output, so be careful if your test involves +# files with spaces in their paths. # # $ assert_pointer "main" "path/to/file" "some-oid" 123 assert_pointer() { @@ -14,7 +17,7 @@ assert_pointer() { while read -r -d $'\0' x; do echo $x done | - grep -F "$path" | cut -f 3 -d " ") + grep -F " $path" | cut -f 3 -d " ") actual=$(git cat-file -p $gitblob) expected=$(pointer $oid $size) @@ -26,6 +29,9 @@ assert_pointer() { # refute_pointer confirms that the file in the repository for $path in the # given $ref is _not_ a pointer. +# Note that $path is prepended with a space to match the against the start +# of path field in the ls-tree output, so be careful if your test involves +# files with spaces in their paths. # # $ refute_pointer "main" "path/to/file" refute_pointer() { @@ -36,7 +42,7 @@ refute_pointer() { while read -r -d $'\0' x; do echo $x done | - grep "$path" | cut -f 3 -d " ") + grep -F " $path" | cut -f 3 -d " ") file=$(git cat-file -p $gitblob) version="version https://git-lfs.github.com/spec/v[0-9]"