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

Re: Test t2028 failes

From
JKJens Krüger <jens.krueger@frm2.tum.de>
Date
Apr 3, 2018, 08:01 UTC
Message-ID
<cdec466c-ecc9-b1d7-c637-04e63552c759@frm2.tum.de>
In-Reply-To
<CAPig+cRTf+WHaSJsLhbPuG0fwd6zkTP_zhwLhB14GdC81xiHRQ@mail.gmail.com>

The actual2 file does not exists, if I call the ./t2028-worktree-move.sh with the '-v -i' options, only without any option or with '-v' option.

Am 03.04.2018 um 08:58 schrieb Eric Sunshine:
Show 24 quoted lines
> On Tue, Apr 3, 2018 at 2:33 AM, Jens Krüger <Jens.Krueger@frm2.tum.de> wrote:
>> *** t2028-worktree-move.sh ***
>> not ok 12 - move worktree
>> #
>> #               toplevel="$(pwd)" &&
>> #               git worktree move source destination &&
>> #               test_path_is_missing source &&
>> #               git worktree list --porcelain >out &&
>> #               grep "^worktree.*/destination" out &&
>> #               ! grep "^worktree.*/source" out &&
>> #               git -C destination log --format=%s >actual2 &&
>> #               echo init >expected2 &&
>> #               test_cmp expected2 actual2
>> #
> 
> Thanks for the report. Can you paste the relevant output (which
> should/might include an error message) from running the test with:
> 
>     ./t2028-worktree-move.sh -v -i
> 
> and show an "ls -l" of t/trash directory.t2028-worktree-move
> directory, as well as paste the content of files "out" and "actual2"
> in that directory?
> 

insgesamt 28 drwxr-xr-x 2 jkrueger jkrueger 4096 Apr 3 09:25 abc -rw-r--r-- 1 jkrueger jkrueger 155 Apr 3 09:25 actual drwxr-xr-x 2 jkrueger jkrueger 4096 Apr 3 09:25 destination drwxr-xr-x 2 jkrueger jkrueger 4096 Apr 3 09:25 elsewhere -rw-r--r-- 1 jkrueger jkrueger 7 Apr 3 09:25 expected -rw-r--r-- 1 jkrueger jkrueger 5 Apr 3 09:25 init.t -rw-r--r-- 1 jkrueger jkrueger 463 Apr 3 09:25 out

Initialized empty Git repository in /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move/.git/
expecting success: 
	test_commit init &&
	git worktree add source &&
	git worktree list --porcelain >out &&
	grep "^worktree" out >actual &&
	cat <<-EOF >expected &&
	worktree $(pwd)
	worktree $(pwd)/source
	EOF
	test_cmp expected actual
[master (root-commit) 2519212] init
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 init.t
Preparing source (identifier source)
HEAD is now at 2519212 init
ok 1 - setup
expecting success: 
	test_must_fail git worktree lock .

fatal: The main working tree cannot be locked or unlocked ok 2 - lock main worktree

expecting success: 
	git worktree lock --reason hahaha source &&
	echo hahaha >expected &&
	test_cmp expected .git/worktrees/source/locked
ok 3 - lock linked worktree
expecting success: 
	rm .git/worktrees/source/locked &&
	git worktree add elsewhere &&
	git -C elsewhere worktree lock --reason hahaha ../source &&
	echo hahaha >expected &&
	test_cmp expected .git/worktrees/source/locked

Preparing elsewhere (identifier elsewhere) HEAD is now at 2519212 init ok 4 - lock linked worktree from another worktree

expecting success: 
	test_must_fail git worktree lock source &&
	echo hahaha >expected &&
	test_cmp expected .git/worktrees/source/locked

fatal: 'source' is already locked, reason: hahaha ok 5 - lock worktree twice

expecting success: 
	test_must_fail git -C source worktree lock . &&
	echo hahaha >expected &&
	test_cmp expected .git/worktrees/source/locked

fatal: '.' is already locked, reason: hahaha ok 6 - lock worktree twice (from the locked worktree)

expecting success: 
	test_must_fail git worktree unlock .

fatal: The main working tree cannot be locked or unlocked ok 7 - unlock main worktree

expecting success: 
	git worktree unlock source &&
	test_path_is_missing .git/worktrees/source/locked
ok 8 - unlock linked worktree
expecting success: 
	test_must_fail git worktree unlock source &&
	test_path_is_missing .git/worktrees/source/locked

fatal: 'source' is not locked ok 9 - unlock worktree twice

expecting success: 
	mkdir abc &&
	test_must_fail git worktree move abc def

fatal: 'abc' is not a working tree ok 10 - move non-worktree

expecting success: 
	git worktree lock source &&
	test_when_finished "git worktree unlock source" &&
	test_must_fail git worktree move source destination

fatal: cannot move a locked working tree ok 11 - move locked worktree

expecting success: 
	toplevel="$(pwd)" &&
	git worktree move source destination &&
	test_path_is_missing source &&
	git worktree list --porcelain >out &&
	grep "^worktree.*/destination" out &&
	! grep "^worktree.*/source" out &&
	git -C destination log --format=%s >actual2 &&
	echo init >expected2 &&
	test_cmp expected2 actual2

worktree /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move/destination worktree /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move worktree /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move/destination worktree /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move/elsewhere not ok 12 - move worktree # # toplevel="$(pwd)" && # git worktree move source destination && # test_path_is_missing source && # git worktree list --porcelain >out && # grep "^worktree.*/destination" out && # ! grep "^worktree.*/source" out && # git -C destination log --format=%s >actual2 && # echo init >expected2 && # test_cmp expected2 actual2 #

worktree /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move worktree /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move/source

worktree /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move HEAD 2519212edd1f577b6196d394a0f08b31d5faa951 branch refs/heads/master

worktree /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move/elsewhere HEAD 2519212edd1f577b6196d394a0f08b31d5faa951 branch refs/heads/elsewhere

worktree /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move/some-dir/destination HEAD 2519212edd1f577b6196d394a0f08b31d5faa951 branch refs/heads/source

Previous: Eric SunshineNext: Eric Sunshine
Message 3 of 9 in “Test t2028 failes”
  1. Jens KrügerApr 3, 2018
  2. Eric SunshineApr 3, 2018
  3. Jens KrügerApr 3, 2018
  4. Eric SunshineApr 3, 2018
  5. Jens KrügerApr 3, 2018
  6. Eric SunshineApr 3, 2018
  7. Jens KrügerApr 3, 2018
  8. Eric SunshineApr 3, 2018
  9. Jens KrügerApr 3, 2018

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.