From: Torsten Bögershausen Date: Tue, 01 Jul 2014 04:26:19 GMT Subject: Re: [PATCH 3/3] cache-tree: Write index with updated cache-tree after commit Message-ID: <53B2386B.4060802@web.de> In-Reply-To: <1404173597-24713-3-git-send-email-dturner@twitter.com> [] diff --git a/t/t0090-cache-tree.sh b/t/t0090-cache-tree.sh index 5383258..d50acb8 100755 --- a/t/t0090-cache-tree.sh +++ b/t/t0090-cache-tree.sh @@ -16,8 +16,31 @@ cmp_cache_tree () { # We don't bother with actually checking the SHA1: # test-dump-cache-tree already verifies that all existing data is # correct. +generate_expected_cache_tree () { + if [ -n "$1" ] + then + local dir="$1/" + else + local dir="$1" + fi I think the Git test cases prefer "test" over "[]": if test -n "$1" then local dir="$1/" else local dir="$1" fi And should there be a && after the "fi" ? And as test -n tests for a non-zero string, could we write like this (and drop the local ?)? if test -n "$1" then dir="$1/" else dir="" fi