SZEDER Gábor <[email protected]> writes:
>> + git commit ${3+"$3"} -m "$2" >act &&
>> + head -1 <act >tmp &&
>> + mv tmp act &&
>
> Here you could swap the order of when you write to 'act' and 'tmp',
> and thus make the 'mv' unnecessary, like this:
>
> git commit [...] >tmp &&
> head -1 act >tmp &&
> [...rest of the test...]
>
> Note also that 'head' (or 'sed' in later tests) can open its input
> file on its own, there's no need to redirect its standard input.
Yup, that is better with a slight fix
git testing-output-from-this-command ... >tmp &&
head -n 1 tmp >actual &&
to actually read from the output kept in the temporary file.
Especially I think bare -<num> is a BSDism that has been
removed from POSIX some time ago.