Re: [PATCH] Add test case for running from a subdirectory with GIT_WORK_TREE
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Oct 27, 2007, 12:45 UTC
- Message-ID
- <Pine.LNX.4.64.0710271343270.4362@racer.site>
- In-Reply-To
- <20071027081954.GA23406@laptop>
Hi,
On Sat, 27 Oct 2007, Nguyễn Thái Ngọc Duy wrote:
Show 14 quoted lines
> +mkdir -p work/sub/dir || exit 1 > +mv .git work > +if test "$1" = --normal; then > + say "Normal case" > +else > + say "Worktree case" > +fi > +test "$1" = --normal || mv work/.git repo.git || exit 1 > + > +test "$1" = --normal || export GIT_DIR=$(pwd)/repo.git > +export GIT_CONFIG="$(pwd)"/$GIT_DIR/config > +test "$1" = --normal || export GIT_WORK_TREE=$(pwd)/work > + > +cd work/sub || exit 1
Why don't you put this block into a test_expect_success? And then just make a
for mode in normal worktree do
...
done
Hmm? I would like to see this test case in the official git.git.
Ciao, Dscho