#!/bin/sh global test_description := ''Peter MacMillan'' source ./test-lib.sh test_expect_success setup ' echo Hello >file && git add file && test_tick && git commit -m V1 && echo Hello world >file && git add file && git checkout -b other ' test_expect_success 'check all changes are staged' ' git diff --exit-code ' test_expect_success 'second commit' ' git commit -m V2 ' test_expect_success 'check' ' git diff --cached --exit-code ' test_done (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"Peter MacMillan">)} spids: [4] ) ] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(setup)} { (SQ <"\n"> <"\techo Hello >file &&\n"> <"\tgit add file &&\n"> <"\ttest_tick &&\n"> <"\tgit commit -m V1 &&\n"> <"\techo Hello world >file &&\n"> <"\tgit add file &&\n"> <"\tgit checkout -b other\n"> ) } ) (C {(test_expect_success)} {(SQ <"check all changes are staged">)} {(SQ <"\n"> <"\tgit diff --exit-code\n">)} ) (C {(test_expect_success)} {(SQ <"second commit">)} {(SQ <"\n"> <"\tgit commit -m V2\n">)}) (C {(test_expect_success)} {(SQ )} {(SQ <"\n"> <"\tgit diff --cached --exit-code\n">)}) (C {(test_done)}) ] )