[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] vc-list-files: Adjust the script to support git worktrees
From: |
Eric Blake |
Subject: |
Re: [PATCH] vc-list-files: Adjust the script to support git worktrees |
Date: |
Thu, 27 Jul 2017 07:17:38 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 |
On 07/27/2017 06:47 AM, Erik Skultety wrote:
> Git's worktree feature creates a ".git" which refers to references from
> the original (main) repository. This makes vc-list-files to fail for
> worktrees since it checks for both file's existence and the file being a
> directory. Checking for existence should be okay in this case, since the
> script doesn't touch anything within ".git" directly. Instead, it
> invokes git commands, which work from within a worktree nicely.
>
> Signed-off-by: Erik Skultety <address@hidden>
> ---
> build-aux/vc-list-files | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks; committed (after adding a ChangeLog entry - yes, gnulib is still
stuck using those)
>
> diff --git a/build-aux/vc-list-files b/build-aux/vc-list-files
> index 2d17eaf69..ad683cc3f 100755
> --- a/build-aux/vc-list-files
> +++ b/build-aux/vc-list-files
> @@ -65,7 +65,7 @@ test $# = 0 && set .
>
> for dir
> do
> - if test -d .git; then
> + if test -e .git; then
> test "x$dir" = x. \
> && dir= sed_esc= \
> || { dir="$dir/"; sed_esc=`echo "$dir"|env sed
> 's,\([\\/]\),\\\\\1,g'`; }
>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature