Re: [PATCH 2/3] contrib/subtree/t: Added tests for .gitsubtree support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Paul Campbell wrote:

> Here's the updated version of the tests:

Just a few more nits:

> --- a/contrib/subtree/t/t7900-subtree.sh
> +++ b/contrib/subtree/t/t7900-subtree.sh
> @@ -465,4 +465,37 @@ test_expect_success 'verify one file change per commit' '
[...]
> +test_expect_success 'change in subtree is pushed okay' '
> +	(cd copy0 && create new_file && git commit -m"Added new_file") &&

Style: this would be easier to read with each command on a separate
line, like so:

	(
		cd copy0 &&
		create new_file &&
		test_tick &&
		git commit -m "Add new_file"
	) &&

[...]
> +test_expect_success 'pull into subtree okay' '
> +	git subtree add --prefix=copy1 sub1 &&
> +	git subtree add --prefix=copy2 sub1 &&
> +	(cd copy1 && create new_file_in_copy1 && git commit -m"Added new_file_in_copy1") &&

Likewise (and as a nice side-benefit, it would avoid a long line that
mailers like to wrap).

> +	git subtree push --prefix=copy1 &&
> +	git subtree pull --prefix=copy2 | grep "^ create mode 100644 copy2/new_file_in_copy1$"

Likewise.  More importantly, this forgets the exit status from "git
subtree pull", so if it were to segfault after writing appropriate
output, the test wouldn't notice.  How about:

	git subtree pull --prefix=copy2 >output &&
	grep "^ create mode 100644 copy2/new_file_in_copy1\$" output

Thanks,
Jonathan
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]