#!/bin/sh

. libtest.sh
. libgit.sh

export LINES=47

tigrc <<EOF
set vertical-split = no
EOF

steps '
	:save-display log-submodule.screen

	:toggle log-options --cc --stat --submodule -p
	:save-display log-submodule-diff.screen
'

test_setup_work_dir()
{
	git_clone 'repo-two' .
	git submodule init
	git submodule update
}

test_tig log

assert_equals 'log-submodule.screen' <<EOF
commit feeb2dfd5e09e887e4b6c901e7d91a4c85a7831d
Refs: [master], {origin/master}, {origin/HEAD}
Author: A. U. Thor <a.u.thor@example.com>
Date:   Sun Sep 6 08:23:30 2009 +0000

    [repo-two] Integrate feature from repo-two-a, repo-two-b, repo-two-c

 repo-two-a | 2 +-
 repo-two-b | 2 +-
 repo-two-c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

commit 7f9d74d1b554e99059334799f56b1307f9c324d4
Author: A. U. Thor <a.u.thor@example.com>
Date:   Mon Aug 3 06:54:50 2009 +0000

    [repo-two] Integrate feature from repo-two-b

 repo-two-b | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit 2bbde7f66edbac9b45b86ad75e6b1e8e02970a67
Author: A. U. Thor <a.u.thor@example.com>
Date:   Wed Jul 8 17:48:20 2009 +0000

    [repo-two] Integrate feature from repo-two-a, repo-two-c

 repo-two-a | 2 +-
 repo-two-c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

commit 3a2603a2ea55ef06860f8d8ec33ee10d95d08117
Author: A. U. Thor <a.u.thor@example.com>
Date:   Wed May 27 03:57:30 2009 +0000

    [repo-two] Creating repository

 .gitmodules | 9 +++++++++
 repo-two-a  | 1 +
 repo-two-b  | 1 +
 repo-two-c  | 1 +
 4 files changed, 12 insertions(+)

commit 9bb0f0da3dd2dec58efa5d8fa9d2b1f4768504e9
Author: A. U. Thor <a.u.thor@example.com>
[log] feeb2dfd5e09e887e4b6c901e7d91a4c85a7831d - line 1 of 69                65%
EOF

assert_equals 'log-submodule-diff.screen' <<EOF
commit feeb2dfd5e09e887e4b6c901e7d91a4c85a7831d
Refs: [master], {origin/master}, {origin/HEAD}
Author: A. U. Thor <a.u.thor@example.com>
Date:   Sun Sep 6 08:23:30 2009 +0000

    [repo-two] Integrate feature from repo-two-a, repo-two-b, repo-two-c
---
 repo-two-a | 2 +-
 repo-two-b | 2 +-
 repo-two-c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

Submodule repo-two-a a1d2fa2..598d4e4:
  > [repo-two-a] Commit 5
Submodule repo-two-b f3866fb..8ab92f1:
  > [repo-two-b] Commit 5
Submodule repo-two-c cd41885..e4b7821:
  > [repo-two-c] Commit 5

commit 7f9d74d1b554e99059334799f56b1307f9c324d4
Author: A. U. Thor <a.u.thor@example.com>
Date:   Mon Aug 3 06:54:50 2009 +0000

    [repo-two] Integrate feature from repo-two-b
---
 repo-two-b | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Submodule repo-two-b e795b27..f3866fb:
  > [repo-two-b] Commit 4
  > [repo-two-b] Commit 3

commit 2bbde7f66edbac9b45b86ad75e6b1e8e02970a67
Author: A. U. Thor <a.u.thor@example.com>
Date:   Wed Jul 8 17:48:20 2009 +0000

    [repo-two] Integrate feature from repo-two-a, repo-two-c
---
 repo-two-a | 2 +-
 repo-two-c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Submodule repo-two-a 7df88b0..a1d2fa2:
  > [repo-two-a] Commit 4
  > [repo-two-a] Commit 3
[log] feeb2dfd5e09e887e4b6c901e7d91a4c85a7831d - line 1 of 130               34%
EOF
