Re: [PATCH v2] bugreport: collect list of populated hooks

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

 



Emily Shaffer wrote:

> --- a/t/t0091-bugreport.sh
> +++ b/t/t0091-bugreport.sh
> @@ -57,5 +57,15 @@ test_expect_success 'can create leading directories outside of a git dir' '
>  	nongit git bugreport -o foo/bar/baz
>  '
>  
> +test_expect_success 'indicates populated hooks' '
> +	test_when_finished rm git-bugreport-hooks.txt &&
> +	test_when_finished rm -fr .git/hooks &&
> +	mkdir .git/hooks &&
> +	touch .git/hooks/applypatch-msg &&
> +	chmod +x .git/hooks/applypatch-msg &&

optional: could use write_script for this

> +	git bugreport -s hooks &&
> +	test_i18ngrep applypatch-msg git-bugreport-hooks.txt

This should work even when translated, so it can use "grep" instead of
test_i18ngrep.

A few more things to test:
- that it doesn't include hooks we *haven't* installed. :)
- that it isn't confused by the default *.sample hooks
- what happens when outside a git repository?

Even without such tests,
Reviewed-by: Jonathan Nieder <jrnieder@xxxxxxxxx>

Thanks.



[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]

  Powered by Linux