#!/bin/sh global test_description := ''hunk edit with "commit -p -m"'' source ./test-lib.sh if ! test_have_prereq PERL { global skip_all := ""skipping '$test_description' tests, perl not available"" test_done } test_expect_success 'setup (initial)' ' echo line1 >file && git add file && git commit -m commit1 ' test_expect_success 'edit hunk "commit -p -m message"' ' test_when_finished "rm -f editor_was_started" && rm -f editor_was_started && echo more >>file && echo e | env GIT_EDITOR=": >editor_was_started" git commit -p -m commit2 file && test -r editor_was_started ' test_expect_success 'edit hunk "commit --dry-run -p -m message"' ' test_when_finished "rm -f editor_was_started" && rm -f editor_was_started && echo more >>file && echo e | env GIT_EDITOR=": >editor_was_started" git commit -p -m commit3 file && test -r editor_was_started ' test_done (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"hunk edit with \"commit -p -m\"">)} spids: [4] ) ] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (If arms: [ (if_arm cond: [(Pipeline children:[(C {(test_have_prereq)} {(PERL)})] negated:True)] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:skip_all) op: Equal rhs: { (DQ ("skipping '") ($ VSub_Name "$test_description") ("' tests, perl not available") ) } spids: [25] ) ] spids: [25] ) (C {(test_done)}) ] spids: [-1 22] ) ] spids: [-1 35] ) (C {(test_expect_success)} {(SQ <"setup (initial)">)} {(SQ <"\n"> <"\techo line1 >file &&\n"> <"\tgit add file &&\n"> <"\tgit commit -m commit1\n">)} ) (C {(test_expect_success)} {(SQ <"edit hunk \"commit -p -m message\"">)} { (SQ <"\n"> <"\ttest_when_finished \"rm -f editor_was_started\" &&\n"> <"\trm -f editor_was_started &&\n"> <"\techo more >>file &&\n"> < "\techo e | env GIT_EDITOR=\": >editor_was_started\" git commit -p -m commit2 file &&\n" > <"\ttest -r editor_was_started\n"> ) } ) (C {(test_expect_success)} {(SQ <"edit hunk \"commit --dry-run -p -m message\"">)} { (SQ <"\n"> <"\ttest_when_finished \"rm -f editor_was_started\" &&\n"> <"\trm -f editor_was_started &&\n"> <"\techo more >>file &&\n"> < "\techo e | env GIT_EDITOR=\": >editor_was_started\" git commit -p -m commit3 file &&\n" > <"\ttest -r editor_was_started\n"> ) } ) (C {(test_done)}) ] )