summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-03-17 13:50:25 -0700
committerJunio C Hamano <gitster@pobox.com>2017-03-17 13:50:25 -0700
commit3edcc048621fee389be6991c90b6a7dd0386c57e (patch)
tree936f84111d29e56d42f008999fa3818823853855 /t
parente1fae930193b3e8ff02cee936605625f63e1d1e4 (diff)
parentbf0231c66140be5194ac76a4a9f79e949c588293 (diff)
downloadgit-3edcc048621fee389be6991c90b6a7dd0386c57e.tar.gz
Merge branch 'sb/rev-parse-show-superproject-root'
From a working tree of a repository, a new option of "rev-parse" lets you ask if the repository is used as a submodule of another project, and where the root level of the working tree of that project (i.e. your superproject) is. * sb/rev-parse-show-superproject-root: rev-parse: add --show-superproject-working-tree
Diffstat (limited to 't')
-rwxr-xr-xt/t1500-rev-parse.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t1500-rev-parse.sh b/t/t1500-rev-parse.sh
index 9ed8b8ccba..03d3c7f6d6 100755
--- a/t/t1500-rev-parse.sh
+++ b/t/t1500-rev-parse.sh
@@ -116,4 +116,18 @@ test_expect_success 'git-path inside sub-dir' '
test_cmp expect actual
'
+test_expect_success 'showing the superproject correctly' '
+ git rev-parse --show-superproject-working-tree >out &&
+ test_must_be_empty out &&
+
+ test_create_repo super &&
+ test_commit -C super test_commit &&
+ test_create_repo sub &&
+ test_commit -C sub test_commit &&
+ git -C super submodule add ../sub dir/sub &&
+ echo $(pwd)/super >expect &&
+ git -C super/dir/sub rev-parse --show-superproject-working-tree >out &&
+ test_cmp expect out
+'
+
test_done