summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-03-17 20:50:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-03-17 20:50:25 (GMT)
commit3edcc048621fee389be6991c90b6a7dd0386c57e (patch)
tree936f84111d29e56d42f008999fa3818823853855 /builtin
parente1fae930193b3e8ff02cee936605625f63e1d1e4 (diff)
parentbf0231c66140be5194ac76a4a9f79e949c588293 (diff)
downloadgit-3edcc048621fee389be6991c90b6a7dd0386c57e.zip
git-3edcc048621fee389be6991c90b6a7dd0386c57e.tar.gz
git-3edcc048621fee389be6991c90b6a7dd0386c57e.tar.bz2
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 'builtin')
-rw-r--r--builtin/rev-parse.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c
index e08677e..2549643 100644
--- a/builtin/rev-parse.c
+++ b/builtin/rev-parse.c
@@ -12,6 +12,7 @@
#include "diff.h"
#include "revision.h"
#include "split-index.h"
+#include "submodule.h"
#define DO_REVS 1
#define DO_NOREV 2
@@ -779,6 +780,12 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
puts(work_tree);
continue;
}
+ if (!strcmp(arg, "--show-superproject-working-tree")) {
+ const char *superproject = get_superproject_working_tree();
+ if (superproject)
+ puts(superproject);
+ continue;
+ }
if (!strcmp(arg, "--show-prefix")) {
if (prefix)
puts(prefix);