Benoit Pierre <benoit.pie...@gmail.com> writes:

> +test_expect_failure 'edit hunk "commit -p -m message"' '
> +     test_when_finished "rm -f editor_was_started" &&

Not just "when finished", run "rm -f" here to make sure that the
file does not exist.  Later other people may add new tests before
this test piece and affect the state of your throw-away working
tree, and you would want to protect yourself from their changes.

> +     echo more >>file &&
> +     echo e | env GIT_EDITOR="touch editor_was_started" git commit -p -m 
> commit2 file &&

Avoid "touch" unless you are interested in the timestamp to be
updated.  Use ": >editor_was_started" or something like that when
you are only interested in "it was not there, now it is".

The same comment applies to the next one.

Thanks.

> +     test -r editor_was_started
> +'
> +
> +test_expect_failure 'edit hunk "commit --dry-run -p -m message"' '
> +     test_when_finished "rm -f editor_was_started" &&
> +     echo more >>file &&
> +     echo e | env GIT_EDITOR="touch editor_was_started" git commit -p -m 
> commit3 file &&
> +     test -r editor_was_started
> +'
> +
> +test_done
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to