Re: [PATCH v2 1/4] t7400-submodule-basic: modernize inspect() helper

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

 



On Tue, Jul 27, 2021 at 10:12:25AM -0700, Jonathan Tan wrote:
> 
> > diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
> > index a924fdb7a6..f5dc051a6e 100755
> > --- a/t/t7400-submodule-basic.sh
> > +++ b/t/t7400-submodule-basic.sh
> > @@ -107,25 +107,18 @@ test_expect_success 'setup - repository to add submodules to' '
> >  # generates, which will expand symbolic links.
> >  submodurl=$(pwd -P)
> >  
> > -listbranches() {
> > -	git for-each-ref --format='%(refname)' 'refs/heads/*'
> > -}
> > -
> >  inspect() {
> >  	dir=$1 &&
> > -	dotdot="${2:-..}" &&
> >  
> > -	(
> > -		cd "$dir" &&
> > -		listbranches >"$dotdot/heads" &&
> > -		{ git symbolic-ref HEAD || :; } >"$dotdot/head" &&
> > -		git rev-parse HEAD >"$dotdot/head-sha1" &&
> > -		git update-index --refresh &&
> > -		git diff-files --exit-code &&
> > -		git clean -n -d -x >"$dotdot/untracked"
> > -	)
> > +	git -C "$dir" for-each-ref --format='%(refname)' 'refs/heads/*' >heads &&
> > +	{ git -C "$dir" symbolic-ref HEAD || :; } >head &&
> > +	git -C "$dir" rev-parse HEAD >head-sha1 &&
> > +	git -C "$dir" update-index --refresh &&
> > +	git -C "$dir" diff-files --exit-code &&
> > +	git -C "$dir" clean -n -d -x >untracked
> >  }
> >  
> > +
> 
> Stray extra line.
> 
> Other than that, this is definitely a good simplification.

Ack, fixed locally. Thanks.

 - Emily



[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