Re: [PATCH 1/1] completion: dir-type optargs for am, format-patch

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

 



"Britton Leo Kerin" <britton.kerin@xxxxxxxxx> writes:

> +	local context_dir=$(__git rev-parse --show-toplevel --show-prefix 2>/dev/null | paste -s -d '/' 2>/dev/null)

Is there a practical difference with the above with

	context_dir=$(pwd)

other than that it will give an empty string outside a git working tree?

If not, I suspect

	local inside

	inside=$(__git rev-parse --is-inside-work-tree) &&
	test "$inside" = true || return

	local context_dir=$(pwd)

might be clearer on the intent.

> +	[ -d "$context_dir" ] || return
> +
> +	COMPREPLY=$(cd $context_dir 2>/dev/null && compgen -d -- "$cur_")

Can $context_dir contain $IFS whitespaces here?

> +}




[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