summaryrefslogtreecommitdiff
path: root/submodule.h
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2017-03-08 23:07:42 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-03-08 23:52:03 (GMT)
commitbf0231c66140be5194ac76a4a9f79e949c588293 (patch)
tree737d073963f47b249c5dcc4b4f2928da25313608 /submodule.h
parente0688e9b28f2c5ff711460ee8b62077be5df2360 (diff)
downloadgit-bf0231c66140be5194ac76a4a9f79e949c588293.zip
git-bf0231c66140be5194ac76a4a9f79e949c588293.tar.gz
git-bf0231c66140be5194ac76a4a9f79e949c588293.tar.bz2
rev-parse: add --show-superproject-working-tree
In some situations it is useful to know if the given repository is a submodule of another repository. Add the flag --show-superproject-working-tree to git-rev-parse to make it easy to find out if there is a superproject. When no superproject exists, the output will be empty. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'submodule.h')
-rw-r--r--submodule.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/submodule.h b/submodule.h
index 05ab674..c8a0c9c 100644
--- a/submodule.h
+++ b/submodule.h
@@ -93,4 +93,12 @@ extern void prepare_submodule_repo_env(struct argv_array *out);
extern void absorb_git_dir_into_superproject(const char *prefix,
const char *path,
unsigned flags);
+
+/*
+ * Return the absolute path of the working tree of the superproject, which this
+ * project is a submodule of. If this repository is not a submodule of
+ * another repository, return NULL.
+ */
+extern const char *get_superproject_working_tree(void);
+
#endif