#!/bin/sh # # Copyright (c) 2005 Junio C Hamano # global test_description := ''git apply --stat --summary test, with --recount '' source ./test-lib.sh global UNC := ''s/^\(@@ -[1-9][0-9]*\),[0-9]* \(+[1-9][0-9]*\),[0-9]* @@/\1,999 \2,999 @@/'' global num := '0' while read title { global num := $( $num + 1 ) test_expect_success $title ' git apply --stat --summary \ <"$TEST_DIRECTORY/t4100/t-apply-$num.patch" >current && test_i18ncmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current ' test_expect_success "$title with recount" ' sed -e "$UNC" <"$TEST_DIRECTORY/t4100/t-apply-$num.patch" | git apply --recount --stat --summary >current && test_i18ncmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current ' } <<\EOF test_done (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"git apply --stat --summary test, with --recount\n"> <"\n">)} spids: [13] ) ] spids: [13] ) (C {(.)} {(./test-lib.sh)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:UNC) op: Equal rhs: { (SQ < "s/^\\(@@ -[1-9][0-9]*\\),[0-9]* \\(+[1-9][0-9]*\\),[0-9]* @@/\\1,999 \\2,999 @@/" > ) } spids: [24] ) ] spids: [24] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:num) op:Equal rhs:{(0)} spids:[30])] spids: [30] ) (While cond: [(C {(read)} {(title)})] body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:num) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{($ VSub_Name "$num")}) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [43 52] ) } spids: [42] ) ] spids: [42] ) (C {(test_expect_success)} {(DQ ($ VSub_Name "$title"))} { (SQ <"\n"> <"\t\tgit apply --stat --summary \\\n"> <"\t\t\t<\"$TEST_DIRECTORY/t4100/t-apply-$num.patch\" >current &&\n"> <"\t\ttest_i18ncmp \"$TEST_DIRECTORY\"/t4100/t-apply-$num.expect current\n"> <"\t"> ) } ) (C {(test_expect_success)} {(DQ ($ VSub_Name "$title") (" with recount"))} { (SQ <"\n"> <"\t\tsed -e \"$UNC\" <\"$TEST_DIRECTORY/t4100/t-apply-$num.patch\" |\n"> <"\t\tgit apply --recount --stat --summary >current &&\n"> <"\t\ttest_i18ncmp \"$TEST_DIRECTORY\"/t4100/t-apply-$num.expect current\n"> <"\t"> ) } ) ] spids: [39 86] ) redirects: [ (HereDoc op_id: Redir_DLess fd: -1 body: {("rename\n") ("copy\n") ("rewrite\n") ("mode\n") ("non git (1)\n") ("non git (2)\n") ("non git (3)\n") ("incomplete (1)\n") ("incomplete (2)\n") } do_expansion: False here_end: EOF was_filled: True spids: [88] ) ] ) (C {(test_done)}) ] )