t: test fetch/prune diff parsing with ANSI escapes
We set the "color.diff" Git configuration directive to "always" in several tests which exercise the scanning and parsing of "git log -p" output in order to validate that they still succeed even with ANSI color code escape sequences in the Git diff output. Unfortunately, at the present time, the tests will no longer succeed as a result of this change, but we intend to resolve that problem in a subsequent commit.
This commit is contained in:
parent
314c30dfc0
commit
2752acc925
@ -105,6 +105,9 @@ begin_test "fetch-recent commits"
|
|||||||
git config lfs.fetchrecentremoterefs false
|
git config lfs.fetchrecentremoterefs false
|
||||||
git config lfs.fetchrecentcommitsdays 7
|
git config lfs.fetchrecentcommitsdays 7
|
||||||
|
|
||||||
|
# force color codes in git diff meta-information
|
||||||
|
git config color.diff always
|
||||||
|
|
||||||
git lfs fetch --recent origin
|
git lfs fetch --recent origin
|
||||||
# that should have fetched main plus previous state needed within 7 days
|
# that should have fetched main plus previous state needed within 7 days
|
||||||
# current state
|
# current state
|
||||||
|
15
t/t-prune.sh
15
t/t-prune.sh
@ -167,6 +167,9 @@ begin_test "prune keep unpushed"
|
|||||||
git config lfs.fetchrecentcommitsdays 0 # only keep AT refs, no recents
|
git config lfs.fetchrecentcommitsdays 0 # only keep AT refs, no recents
|
||||||
git config lfs.pruneoffsetdays 2
|
git config lfs.pruneoffsetdays 2
|
||||||
|
|
||||||
|
# force color codes in git diff meta-information
|
||||||
|
git config color.diff always
|
||||||
|
|
||||||
git lfs prune
|
git lfs prune
|
||||||
|
|
||||||
# Now push main and show that older versions on main will be removed
|
# Now push main and show that older versions on main will be removed
|
||||||
@ -316,6 +319,9 @@ begin_test "prune keep recent"
|
|||||||
git config lfs.fetchrecentcommitsdays 1
|
git config lfs.fetchrecentcommitsdays 1
|
||||||
git config lfs.pruneoffsetdays 1
|
git config lfs.pruneoffsetdays 1
|
||||||
|
|
||||||
|
# force color codes in git diff meta-information
|
||||||
|
git config color.diff always
|
||||||
|
|
||||||
# push everything so that's not a reason to retain
|
# push everything so that's not a reason to retain
|
||||||
git push origin main:main branch_old:branch_old branch1:branch1 branch2:branch2
|
git push origin main:main branch_old:branch_old branch1:branch1 branch2:branch2
|
||||||
|
|
||||||
@ -669,6 +675,9 @@ begin_test "prune keep stashed changes"
|
|||||||
assert_local_object "$oid_stashed" "${#content_stashed}"
|
assert_local_object "$oid_stashed" "${#content_stashed}"
|
||||||
assert_local_object "$oid_stashedbranch" "${#content_stashedbranch}"
|
assert_local_object "$oid_stashedbranch" "${#content_stashedbranch}"
|
||||||
|
|
||||||
|
# force color codes in git diff meta-information
|
||||||
|
git config color.diff always
|
||||||
|
|
||||||
# Prune data, should NOT delete stashed files
|
# Prune data, should NOT delete stashed files
|
||||||
git lfs prune
|
git lfs prune
|
||||||
|
|
||||||
@ -767,6 +776,9 @@ begin_test "prune keep stashed changes in index"
|
|||||||
assert_local_object "$oid_indexstashedbranch" "${#content_indexstashedbranch}"
|
assert_local_object "$oid_indexstashedbranch" "${#content_indexstashedbranch}"
|
||||||
assert_local_object "$oid_stashedbranch" "${#content_stashedbranch}"
|
assert_local_object "$oid_stashedbranch" "${#content_stashedbranch}"
|
||||||
|
|
||||||
|
# force color codes in git diff meta-information
|
||||||
|
git config color.diff always
|
||||||
|
|
||||||
# Prune data, should NOT delete stashed file or stashed changes to index
|
# Prune data, should NOT delete stashed file or stashed changes to index
|
||||||
git lfs prune
|
git lfs prune
|
||||||
|
|
||||||
@ -884,6 +896,9 @@ begin_test "prune keep stashed untracked files"
|
|||||||
assert_local_object "$oid_stashedbranch" "${#content_stashedbranch}"
|
assert_local_object "$oid_stashedbranch" "${#content_stashedbranch}"
|
||||||
assert_local_object "$oid_untrackedstashedbranch" "${#content_untrackedstashedbranch}"
|
assert_local_object "$oid_untrackedstashedbranch" "${#content_untrackedstashedbranch}"
|
||||||
|
|
||||||
|
# force color codes in git diff meta-information
|
||||||
|
git config color.diff always
|
||||||
|
|
||||||
# Prune data, should NOT delete stashed file or stashed changes to index
|
# Prune data, should NOT delete stashed file or stashed changes to index
|
||||||
git lfs prune
|
git lfs prune
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user