git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] Add an explicit GIT_DIR to the list of excludes

From
Eric Sunshine <sunshine@sunshineco.com>
Date
May 23, 2014, 04:39 UTC
Message-ID
<CAPig+cTZuxd7vFdoLDb=_CUuoaKbHLKRftvBJd6XQDD_5R5+tA@mail.gmail.com>
In-Reply-To
<1400789477-27906-1-git-send-email-pasha.bolokhov@gmail.com>

On Thu, May 22, 2014 at 4:11 PM, Pasha Bolokhov <pasha.bolokhov@gmail.com> wrote:

Show 20 quoted lines
> diff --git a/t/t2205-add-gitdir.sh b/t/t2205-add-gitdir.sh
> new file mode 100755
> index 0000000..3c6b853
> --- /dev/null
> +++ b/t/t2205-add-gitdir.sh
> @@ -0,0 +1,61 @@
> +#!/bin/sh
> +#
> +# Copyright (c) 2014 Pasha Bolokhov
> +#
> +
> +test_description='alternative repository path specified by --git-dir is ignored by add and status'
> +
> +. ./test-lib.sh
> +
> +test_expect_success "setup" '
> +       git --git-dir=meta init &&
> +       for f in a b c d
> +       do
> +               echo "DATA" > "$f" || exit 1

On this project, it's customary to say 'foo >bar' (no whitespace after '>'). Ditto for the rest of the file.

Show 17 quoted lines
> +       done &&
> +       mkdir subdir1 &&
> +       for f in e f g h
> +       do
> +               echo "MORE DATA" > "subdir1/$f" || exit 1
> +       done &&
> +       mkdir subdir1/meta &&
> +       echo "EVEN more Data" > subdir1/meta/aa &&
> +       mkdir subdir1/ssubdir subdir1/ssubdir/meta &&
> +       echo "So much more data" > subdir1/ssubdir/meta/aaa
> +'
> +
> +test_expect_success "'git status' acknowledges files 'meta' if repository is not within work tree" '
> +       test_might_fail rm -rf meta/ &&
> +       (
> +               cd subdir1 &&
> +               git --git-dir=../meta init
Broken &&-chain.
Show 9 quoted lines
> +               git --git-dir=../meta --work-tree=. status --porcelain > status2.out &&
> +               test_might_fail grep meta status2.out > out2 &&
> +               test -s out2
> +       )
> +'
> +
> +test_done
> --
> 1.9.1
Previous: Pasha Bolokhov
Message 2 of 2 in “Add an explicit GIT_DIR to the list of excludes”
  1. Add an explicit GIT_DIR to the list of excludesPasha Bolokhov, May 22, 2014
  2. Eric SunshineMay 23, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.