18
#include "strbuf.h"
19
#include "string-list.h"
20
#include "shallow.h"
21
+#include "submodule.h"
22
#include "tree.h"
23
#include "tree-walk.h"
24
#include "utf8.h"
122
return 0;
123
}
124
125
+static int get_path_superproject_absolute(struct repository *repo UNUSED, struct strbuf *buf)
126
+{
127
+ struct strbuf superproject = STRBUF_INIT;
128
+
129
+ if (!get_superproject_working_tree(&superproject)) {
130
+ strbuf_release(&superproject);
131
+ strbuf_addstr(buf, "");
132
+ return 0;
133
+ }
134
+
135
+ format_path(buf, superproject.buf, startup_info->prefix, PATH_FORMAT_CANONICAL);
136
+ strbuf_release(&superproject);
137
+ return 0;
138
+}
139
+
140
+static int get_path_superproject_relative(struct repository *repo UNUSED, struct strbuf *buf)
141
+{
142
+ struct strbuf superproject = STRBUF_INIT;
143
+
144
+ if (!get_superproject_working_tree(&superproject)) {
145
+ strbuf_release(&superproject);
146
+ strbuf_addstr(buf, "");
147
+ return 0;
148
+ }
149
+
150
+ format_path(buf, superproject.buf, startup_info->prefix, PATH_FORMAT_RELATIVE);
151
+ strbuf_release(&superproject);
152
+ return 0;
153
+}
154
+
155
static int get_path_toplevel_absolute(struct repository *repo, struct strbuf *buf)
156
{
157
const char *work_tree = repo_get_work_tree(repo);
194
{ "path.commondir.relative", get_path_commondir_relative },
195
{ "path.gitdir.absolute", get_path_gitdir_absolute },
196
{ "path.gitdir.relative", get_path_gitdir_relative },
197
+ { "path.superproject-working-tree.absolute", get_path_superproject_absolute },
198
+ { "path.superproject-working-tree.relative", get_path_superproject_relative },
199
{ "path.toplevel.absolute", get_path_toplevel_absolute },
200
{ "path.toplevel.relative", get_path_toplevel_relative },
201
{ "references.format", get_references_format },