aboutsummaryrefslogtreecommitdiffstats
path: root/t/t8007-cat-file-textconv.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t8007-cat-file-textconv.sh')
-rwxr-xr-xt/t8007-cat-file-textconv.sh70
1 files changed, 70 insertions, 0 deletions
diff --git a/t/t8007-cat-file-textconv.sh b/t/t8007-cat-file-textconv.sh
new file mode 100755
index 0000000000..38ac05e4a0
--- /dev/null
+++ b/t/t8007-cat-file-textconv.sh
@@ -0,0 +1,70 @@
+#!/bin/sh
+
+test_description='git cat-file textconv support'
+. ./test-lib.sh
+
+cat >helper <<'EOF'
+#!/bin/sh
+sed 's/^/converted: /' "$@"
+EOF
+chmod +x helper
+
+test_expect_success 'setup ' '
+ echo test >one.bin &&
+ git add . &&
+ GIT_AUTHOR_NAME=Number1 git commit -a -m First --date="2010-01-01 18:00:00" &&
+ echo test version 2 >one.bin &&
+ GIT_AUTHOR_NAME=Number2 git commit -a -m Second --date="2010-01-01 20:00:00"
+'
+
+cat >expected <<EOF
+fatal: git cat-file --textconv: unable to run textconv on :one.bin
+EOF
+
+test_expect_success 'no filter specified' '
+ git cat-file --textconv :one.bin 2>result
+ test_cmp expected result
+'
+
+test_expect_success 'setup textconv filters' '
+ echo "*.bin diff=test" >.gitattributes &&
+ git config diff.test.textconv ./helper &&
+ git config diff.test.cachetextconv false
+'
+
+cat >expected <<EOF
+test version 2
+EOF
+
+test_expect_success 'cat-file without --textconv' '
+ git cat-file blob :one.bin >result &&
+ test_cmp expected result
+'
+
+cat >expected <<EOF
+test
+EOF
+
+test_expect_success 'cat-file without --textconv on previous commit' '
+ git cat-file -p HEAD^:one.bin >result &&
+ test_cmp expected result
+'
+
+cat >expected <<EOF
+converted: test version 2
+EOF
+
+test_expect_success 'cat-file --textconv on last commit' '
+ git cat-file --textconv :one.bin >result &&
+ test_cmp expected result
+'
+
+cat >expected <<EOF
+converted: test
+EOF
+
+test_expect_success 'cat-file --textconv on previous commit' '
+ git cat-file --textconv HEAD^:one.bin >result &&
+ test_cmp expected result
+'
+test_done
9nfp: flower: handle notifiers for ipv6 route changesJohn Hurley2-68/+181 2019-12-19nfp: flower: handle ipv6 tunnel no neigh requestJohn Hurley4-8/+116 2019-12-19nfp: flower: modify pre-tunnel and set tunnel action for ipv6John Hurley3-30/+62 2019-12-19nfp: flower: offload list of IPv6 tunnel endpoint addressesJohn Hurley5-1/+141 2019-12-19nfp: flower: compile match for IPv6 tunnelsJohn Hurley4-51/+246 2019-12-19nfp: flower: move udp tunnel key match compilation to helper functionJohn Hurley1-22/+35 2019-12-19nfp: flower: pass flow rule pointer directly to match functionsJohn Hurley1-49/+27 2019-12-19hdlcdrv: replace unnecessary assertion in hdlcdrv_registerAditya Pakki1-2/+0 2019-12-19net: mvpp2: cycle comphy to power it downRussell King1-0/+10 2019-12-19net: sfp: report error on failure to read sfp soft statusRussell King1-2/+9 2019-12-19net: phy: marvell: use genphy_check_and_restart_aneg()Russell King1-20/+1 2019-12-19net: phy: marvell: use phy_modify_changed()Russell King1-16/+10 2019-12-19net: phy: marvell: use existing clause 37 definitionsRussell King1-18/+8 2019-12-19net: phy: marvell: consolidate phy status readingRussell King1-43/+17 2019-12-19net: phy: marvell: use positive logic for link stateRussell King1-4/+3 2019-12-19net: phy: marvell: initialise link partner state earlierRussell King1-20/+5 2019-12-19net: phy: marvell: rearrange to use genphy_read_lpa()Russell King1-34/+32 2019-12-19net: phy: provide and use genphy_read_status_fixed()Russell King4-47/+41 2019-12-19net: phy: add genphy_check_and_restart_aneg()Russell King2-17/+32 2019-12-19net: phy: use phy_resolve_aneg_pause()Russell King3-14/+3 2019-12-19net: phy: remove redundant .aneg_done initialisersRussell King2-7/+0 2019-12-18net: stmmac: tc: Fix TAPRIO division operationJose Abreu1-2/+4