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>
This commit is contained in:

committed by
Junio C Hamano

parent
e0688e9b28
commit
bf0231c661
@ -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
|
||||
|
Reference in New Issue
Block a user