Coverage Report

Created: 2024-09-08 06:24

/src/git/path.h
Line
Count
Source (jump to first uncovered line)
1
#ifndef PATH_H
2
#define PATH_H
3
4
struct repository;
5
struct strbuf;
6
struct string_list;
7
struct worktree;
8
9
/*
10
 * The result to all functions which return statically allocated memory may be
11
 * overwritten by another call to _any_ one of these functions. Consider using
12
 * the safer variants which operate on strbufs or return allocated memory.
13
 */
14
15
/*
16
 * Return a statically allocated path.
17
 */
18
const char *mkpath(const char *fmt, ...)
19
  __attribute__((format (printf, 1, 2)));
20
21
/*
22
 * Return a path.
23
 */
24
char *mkpathdup(const char *fmt, ...)
25
  __attribute__((format (printf, 1, 2)));
26
27
/*
28
 * The `strbuf_git_common_path` family of functions will construct a path into a
29
 * repository's common git directory, which is shared by all worktrees.
30
 */
31
32
/*
33
 * Constructs a path into the common git directory of repository `repo` and
34
 * append it in the provided buffer `sb`.
35
 */
36
void strbuf_git_common_path(struct strbuf *sb,
37
          const struct repository *repo,
38
          const char *fmt, ...)
39
  __attribute__((format (printf, 3, 4)));
40
void repo_common_pathv(const struct repository *repo,
41
           struct strbuf *buf,
42
           const char *fmt,
43
           va_list args);
44
45
/*
46
 * The `repo_git_path` family of functions will construct a path into a repository's
47
 * git directory.
48
 *
49
 * These functions will perform adjustments to the resultant path to account
50
 * for special paths which are either considered common among worktrees (e.g.
51
 * paths into the object directory) or have been explicitly set via an
52
 * environment variable or config (e.g. path to the index file).
53
 *
54
 * For an exhaustive list of the adjustments made look at `common_list` and
55
 * `adjust_git_path` in path.c.
56
 */
57
58
/*
59
 * Return a path into the git directory of repository `repo`.
60
 */
61
char *repo_git_path(const struct repository *repo,
62
        const char *fmt, ...)
63
  __attribute__((format (printf, 2, 3)));
64
65
/*
66
 * Print a path into the git directory of repository `repo` into the provided
67
 * buffer.
68
 */
69
void repo_git_pathv(const struct repository *repo,
70
        const struct worktree *wt, struct strbuf *buf,
71
        const char *fmt, va_list args);
72
73
/*
74
 * Construct a path into the git directory of repository `repo` and append it
75
 * to the provided buffer `sb`.
76
 */
77
void strbuf_repo_git_path(struct strbuf *sb,
78
        const struct repository *repo,
79
        const char *fmt, ...)
80
  __attribute__((format (printf, 3, 4)));
81
82
/*
83
 * Similar to repo_git_path() but can produce paths for a specified
84
 * worktree instead of current one. When no worktree is given, then the path is
85
 * computed relative to main worktree of the given repository.
86
 */
87
const char *worktree_git_path(struct repository *r,
88
            const struct worktree *wt,
89
            const char *fmt, ...)
90
  __attribute__((format (printf, 3, 4)));
91
92
/*
93
 * Return a path into the worktree of repository `repo`.
94
 *
95
 * If the repository doesn't have a worktree NULL is returned.
96
 */
97
char *repo_worktree_path(const struct repository *repo,
98
        const char *fmt, ...)
99
  __attribute__((format (printf, 2, 3)));
100
101
/*
102
 * Construct a path into the worktree of repository `repo` and append it
103
 * to the provided buffer `sb`.
104
 *
105
 * If the repository doesn't have a worktree nothing will be appended to `sb`.
106
 */
107
void strbuf_repo_worktree_path(struct strbuf *sb,
108
              const struct repository *repo,
109
              const char *fmt, ...)
110
  __attribute__((format (printf, 3, 4)));
111
112
/*
113
 * Return a path into a submodule's git directory located at `path`.  `path`
114
 * must only reference a submodule of the main repository (the_repository).
115
 */
116
char *git_pathdup_submodule(const char *path, const char *fmt, ...)
117
  __attribute__((format (printf, 2, 3)));
118
119
/*
120
 * Construct a path into a submodule's git directory located at `path` and
121
 * append it to the provided buffer `sb`.  `path` must only reference a
122
 * submodule of the main repository (the_repository).
123
 */
124
int strbuf_git_path_submodule(struct strbuf *sb, const char *path,
125
             const char *fmt, ...)
126
  __attribute__((format (printf, 3, 4)));
127
128
void report_linked_checkout_garbage(struct repository *r);
129
130
/*
131
 * You can define a static memoized git path like:
132
 *
133
 *    static REPO_GIT_PATH_FUNC(git_path_foo, "FOO")
134
 *
135
 * or use one of the global ones below.
136
 */
137
#define REPO_GIT_PATH_FUNC(var, filename) \
138
  const char *git_path_##var(struct repository *r) \
139
47.0k
  { \
140
47.0k
    if (!r->cached_paths.var) \
141
47.0k
      r->cached_paths.var = repo_git_path(r, filename); \
142
47.0k
    return r->cached_paths.var; \
143
47.0k
  }
git_path_squash_msg
Line
Count
Source
139
9.08k
  { \
140
9.08k
    if (!r->cached_paths.var) \
141
9.08k
      r->cached_paths.var = repo_git_path(r, filename); \
142
9.08k
    return r->cached_paths.var; \
143
9.08k
  }
git_path_merge_msg
Line
Count
Source
139
9.08k
  { \
140
9.08k
    if (!r->cached_paths.var) \
141
9.08k
      r->cached_paths.var = repo_git_path(r, filename); \
142
9.08k
    return r->cached_paths.var; \
143
9.08k
  }
Unexecuted instantiation: git_path_merge_rr
git_path_merge_mode
Line
Count
Source
139
9.08k
  { \
140
9.08k
    if (!r->cached_paths.var) \
141
9.08k
      r->cached_paths.var = repo_git_path(r, filename); \
142
9.08k
    return r->cached_paths.var; \
143
9.08k
  }
git_path_merge_head
Line
Count
Source
139
18.3k
  { \
140
18.3k
    if (!r->cached_paths.var) \
141
18.3k
      r->cached_paths.var = repo_git_path(r, filename); \
142
18.3k
    return r->cached_paths.var; \
143
18.3k
  }
Unexecuted instantiation: git_path_fetch_head
git_path_shallow
Line
Count
Source
139
1.46k
  { \
140
1.46k
    if (!r->cached_paths.var) \
141
1.46k
      r->cached_paths.var = repo_git_path(r, filename); \
142
1.46k
    return r->cached_paths.var; \
143
1.46k
  }
144
145
const char *git_path_squash_msg(struct repository *r);
146
const char *git_path_merge_msg(struct repository *r);
147
const char *git_path_merge_rr(struct repository *r);
148
const char *git_path_merge_mode(struct repository *r);
149
const char *git_path_merge_head(struct repository *r);
150
const char *git_path_fetch_head(struct repository *r);
151
const char *git_path_shallow(struct repository *r);
152
153
int ends_with_path_components(const char *path, const char *components);
154
155
int calc_shared_perm(int mode);
156
int adjust_shared_perm(const char *path);
157
158
char *interpolate_path(const char *path, int real_home);
159
const char *enter_repo(const char *path, int strict);
160
const char *remove_leading_path(const char *in, const char *prefix);
161
const char *relative_path(const char *in, const char *prefix, struct strbuf *sb);
162
int normalize_path_copy_len(char *dst, const char *src, int *prefix_len);
163
int normalize_path_copy(char *dst, const char *src);
164
/**
165
 * Normalize in-place the path contained in the strbuf. If an error occurs,
166
 * the contents of "sb" are left untouched, and -1 is returned.
167
 */
168
int strbuf_normalize_path(struct strbuf *src);
169
int longest_ancestor_length(const char *path, struct string_list *prefixes);
170
char *strip_path_suffix(const char *path, const char *suffix);
171
int daemon_avoid_alias(const char *path);
172
173
/*
174
 * These functions match their is_hfs_dotgit() counterparts; see utf8.h for
175
 * details.
176
 */
177
int is_ntfs_dotgit(const char *name);
178
int is_ntfs_dotgitmodules(const char *name);
179
int is_ntfs_dotgitignore(const char *name);
180
int is_ntfs_dotgitattributes(const char *name);
181
int is_ntfs_dotmailmap(const char *name);
182
183
/*
184
 * Returns true iff "str" could be confused as a command-line option when
185
 * passed to a sub-program like "ssh". Note that this has nothing to do with
186
 * shell-quoting, which should be handled separately; we're assuming here that
187
 * the string makes it verbatim to the sub-program.
188
 */
189
int looks_like_command_line_option(const char *str);
190
191
/**
192
 * Return a newly allocated string with the evaluation of
193
 * "$XDG_CONFIG_HOME/$subdir/$filename" if $XDG_CONFIG_HOME is non-empty, otherwise
194
 * "$HOME/.config/$subdir/$filename". Return NULL upon error.
195
 */
196
char *xdg_config_home_for(const char *subdir, const char *filename);
197
198
/**
199
 * Return a newly allocated string with the evaluation of
200
 * "$XDG_CONFIG_HOME/git/$filename" if $XDG_CONFIG_HOME is non-empty, otherwise
201
 * "$HOME/.config/git/$filename". Return NULL upon error.
202
 */
203
char *xdg_config_home(const char *filename);
204
205
/**
206
 * Return a newly allocated string with the evaluation of
207
 * "$XDG_CACHE_HOME/git/$filename" if $XDG_CACHE_HOME is non-empty, otherwise
208
 * "$HOME/.cache/git/$filename". Return NULL upon error.
209
 */
210
char *xdg_cache_home(const char *filename);
211
212
/*
213
 * Create a directory and (if share is nonzero) adjust its permissions
214
 * according to the shared_repository setting. Only use this for
215
 * directories under $GIT_DIR.  Don't use it for working tree
216
 * directories.
217
 */
218
void safe_create_dir(const char *dir, int share);
219
220
/*
221
 * Do not use this function. It is only exported to other subsystems until we
222
 * can get rid of the below block of functions that implicitly rely on
223
 * `the_repository`.
224
 */
225
struct strbuf *get_pathname(void);
226
227
# ifdef USE_THE_REPOSITORY_VARIABLE
228
#  include "strbuf.h"
229
#  include "repository.h"
230
231
/*
232
 * Return a statically allocated path into the main repository's
233
 * (the_repository) common git directory.
234
 */
235
__attribute__((format (printf, 1, 2)))
236
static inline const char *git_common_path(const char *fmt, ...)
237
0
{
238
0
  struct strbuf *pathname = get_pathname();
239
0
  va_list args;
240
0
  va_start(args, fmt);
241
0
  repo_common_pathv(the_repository, pathname, fmt, args);
242
0
  va_end(args);
243
0
  return pathname->buf;
244
0
}
Unexecuted instantiation: add.c:git_common_path
Unexecuted instantiation: am.c:git_common_path
Unexecuted instantiation: bisect.c:git_common_path
Unexecuted instantiation: branch.c:git_common_path
Unexecuted instantiation: checkout.c:git_common_path
Unexecuted instantiation: clean.c:git_common_path
Unexecuted instantiation: clone.c:git_common_path
Unexecuted instantiation: commit.c:git_common_path
Unexecuted instantiation: config.c:git_common_path
Unexecuted instantiation: count-objects.c:git_common_path
Unexecuted instantiation: credential-cache.c:git_common_path
Unexecuted instantiation: credential-store.c:git_common_path
Unexecuted instantiation: fast-import.c:git_common_path
Unexecuted instantiation: fetch.c:git_common_path
Unexecuted instantiation: for-each-repo.c:git_common_path
Unexecuted instantiation: fsck.c:git_common_path
Unexecuted instantiation: gc.c:git_common_path
Unexecuted instantiation: grep.c:git_common_path
Unexecuted instantiation: help.c:git_common_path
Unexecuted instantiation: init-db.c:git_common_path
Unexecuted instantiation: ls-files.c:git_common_path
Unexecuted instantiation: ls-tree.c:git_common_path
Unexecuted instantiation: merge.c:git_common_path
Unexecuted instantiation: notes.c:git_common_path
Unexecuted instantiation: prune.c:git_common_path
Unexecuted instantiation: pull.c:git_common_path
Unexecuted instantiation: rebase.c:git_common_path
Unexecuted instantiation: receive-pack.c:git_common_path
Unexecuted instantiation: remote.c:git_common_path
Unexecuted instantiation: repack.c:git_common_path
Unexecuted instantiation: replace.c:git_common_path
Unexecuted instantiation: reset.c:git_common_path
Unexecuted instantiation: rev-parse.c:git_common_path
Unexecuted instantiation: submodule--helper.c:git_common_path
Unexecuted instantiation: tag.c:git_common_path
Unexecuted instantiation: upload-archive.c:git_common_path
Unexecuted instantiation: upload-pack.c:git_common_path
Unexecuted instantiation: var.c:git_common_path
Unexecuted instantiation: worktree.c:git_common_path
Unexecuted instantiation: apply.c:git_common_path
Unexecuted instantiation: archive.c:git_common_path
Unexecuted instantiation: attr.c:git_common_path
Unexecuted instantiation: blame.c:git_common_path
Unexecuted instantiation: commit-graph.c:git_common_path
Unexecuted instantiation: connect.c:git_common_path
Unexecuted instantiation: dir.c:git_common_path
Unexecuted instantiation: editor.c:git_common_path
Unexecuted instantiation: environment.c:git_common_path
Unexecuted instantiation: fetch-pack.c:git_common_path
Unexecuted instantiation: gpg-interface.c:git_common_path
Unexecuted instantiation: merge-ort.c:git_common_path
Unexecuted instantiation: merge-recursive.c:git_common_path
Unexecuted instantiation: midx-write.c:git_common_path
Unexecuted instantiation: notes-merge.c:git_common_path
Unexecuted instantiation: object-file.c:git_common_path
Unexecuted instantiation: pack-bitmap-write.c:git_common_path
Unexecuted instantiation: pack-write.c:git_common_path
Unexecuted instantiation: read-cache.c:git_common_path
Unexecuted instantiation: refs.c:git_common_path
Unexecuted instantiation: reftable-backend.c:git_common_path
Unexecuted instantiation: rerere.c:git_common_path
Unexecuted instantiation: revision.c:git_common_path
Unexecuted instantiation: sequencer.c:git_common_path
Unexecuted instantiation: server-info.c:git_common_path
Unexecuted instantiation: setup.c:git_common_path
Unexecuted instantiation: shallow.c:git_common_path
Unexecuted instantiation: submodule-config.c:git_common_path
Unexecuted instantiation: submodule.c:git_common_path
Unexecuted instantiation: tmp-objdir.c:git_common_path
Unexecuted instantiation: wt-status.c:git_common_path
Unexecuted instantiation: loose.c:git_common_path
245
246
/*
247
 * Construct a path into the main repository's (the_repository) git directory
248
 * and place it in the provided buffer `buf`, the contents of the buffer will
249
 * be overridden.
250
 */
251
__attribute__((format (printf, 2, 3)))
252
static inline char *git_path_buf(struct strbuf *buf, const char *fmt, ...)
253
8.47k
{
254
8.47k
  va_list args;
255
8.47k
  strbuf_reset(buf);
256
8.47k
  va_start(args, fmt);
257
8.47k
  repo_git_pathv(the_repository, NULL, buf, fmt, args);
258
8.47k
  va_end(args);
259
8.47k
  return buf->buf;
260
8.47k
}
Unexecuted instantiation: add.c:git_path_buf
Unexecuted instantiation: am.c:git_path_buf
Unexecuted instantiation: bisect.c:git_path_buf
Unexecuted instantiation: branch.c:git_path_buf
Unexecuted instantiation: checkout.c:git_path_buf
Unexecuted instantiation: clean.c:git_path_buf
Unexecuted instantiation: clone.c:git_path_buf
Unexecuted instantiation: commit.c:git_path_buf
Unexecuted instantiation: config.c:git_path_buf
Unexecuted instantiation: count-objects.c:git_path_buf
Unexecuted instantiation: credential-cache.c:git_path_buf
Unexecuted instantiation: credential-store.c:git_path_buf
Unexecuted instantiation: fast-import.c:git_path_buf
Unexecuted instantiation: fetch.c:git_path_buf
Unexecuted instantiation: for-each-repo.c:git_path_buf
Unexecuted instantiation: fsck.c:git_path_buf
Unexecuted instantiation: gc.c:git_path_buf
Unexecuted instantiation: grep.c:git_path_buf
Unexecuted instantiation: help.c:git_path_buf
Unexecuted instantiation: init-db.c:git_path_buf
Unexecuted instantiation: ls-files.c:git_path_buf
Unexecuted instantiation: ls-tree.c:git_path_buf
Unexecuted instantiation: merge.c:git_path_buf
Unexecuted instantiation: notes.c:git_path_buf
Unexecuted instantiation: prune.c:git_path_buf
Unexecuted instantiation: pull.c:git_path_buf
Unexecuted instantiation: rebase.c:git_path_buf
Unexecuted instantiation: receive-pack.c:git_path_buf
Unexecuted instantiation: remote.c:git_path_buf
Unexecuted instantiation: repack.c:git_path_buf
Unexecuted instantiation: replace.c:git_path_buf
Unexecuted instantiation: reset.c:git_path_buf
Unexecuted instantiation: rev-parse.c:git_path_buf
Unexecuted instantiation: submodule--helper.c:git_path_buf
Unexecuted instantiation: tag.c:git_path_buf
Unexecuted instantiation: upload-archive.c:git_path_buf
Unexecuted instantiation: upload-pack.c:git_path_buf
Unexecuted instantiation: var.c:git_path_buf
Unexecuted instantiation: worktree.c:git_path_buf
Unexecuted instantiation: apply.c:git_path_buf
Unexecuted instantiation: archive.c:git_path_buf
Unexecuted instantiation: attr.c:git_path_buf
Unexecuted instantiation: blame.c:git_path_buf
Unexecuted instantiation: commit-graph.c:git_path_buf
Unexecuted instantiation: connect.c:git_path_buf
Unexecuted instantiation: dir.c:git_path_buf
Unexecuted instantiation: editor.c:git_path_buf
Unexecuted instantiation: environment.c:git_path_buf
Unexecuted instantiation: fetch-pack.c:git_path_buf
Unexecuted instantiation: gpg-interface.c:git_path_buf
Unexecuted instantiation: merge-ort.c:git_path_buf
Unexecuted instantiation: merge-recursive.c:git_path_buf
Unexecuted instantiation: midx-write.c:git_path_buf
Unexecuted instantiation: notes-merge.c:git_path_buf
Unexecuted instantiation: object-file.c:git_path_buf
Unexecuted instantiation: pack-bitmap-write.c:git_path_buf
Unexecuted instantiation: pack-write.c:git_path_buf
Unexecuted instantiation: read-cache.c:git_path_buf
Unexecuted instantiation: refs.c:git_path_buf
Unexecuted instantiation: reftable-backend.c:git_path_buf
Unexecuted instantiation: rerere.c:git_path_buf
Unexecuted instantiation: revision.c:git_path_buf
Unexecuted instantiation: sequencer.c:git_path_buf
Unexecuted instantiation: server-info.c:git_path_buf
setup.c:git_path_buf
Line
Count
Source
253
8.47k
{
254
8.47k
  va_list args;
255
8.47k
  strbuf_reset(buf);
256
8.47k
  va_start(args, fmt);
257
8.47k
  repo_git_pathv(the_repository, NULL, buf, fmt, args);
258
8.47k
  va_end(args);
259
8.47k
  return buf->buf;
260
8.47k
}
Unexecuted instantiation: shallow.c:git_path_buf
Unexecuted instantiation: submodule-config.c:git_path_buf
Unexecuted instantiation: submodule.c:git_path_buf
Unexecuted instantiation: tmp-objdir.c:git_path_buf
Unexecuted instantiation: wt-status.c:git_path_buf
Unexecuted instantiation: loose.c:git_path_buf
261
262
/*
263
 * Construct a path into the main repository's (the_repository) git directory
264
 * and append it to the provided buffer `sb`.
265
 */
266
__attribute__((format (printf, 2, 3)))
267
static inline void strbuf_git_path(struct strbuf *sb, const char *fmt, ...)
268
0
{
269
0
  va_list args;
270
0
  va_start(args, fmt);
271
0
  repo_git_pathv(the_repository, NULL, sb, fmt, args);
272
0
  va_end(args);
273
0
}
Unexecuted instantiation: add.c:strbuf_git_path
Unexecuted instantiation: am.c:strbuf_git_path
Unexecuted instantiation: bisect.c:strbuf_git_path
Unexecuted instantiation: branch.c:strbuf_git_path
Unexecuted instantiation: checkout.c:strbuf_git_path
Unexecuted instantiation: clean.c:strbuf_git_path
Unexecuted instantiation: clone.c:strbuf_git_path
Unexecuted instantiation: commit.c:strbuf_git_path
Unexecuted instantiation: config.c:strbuf_git_path
Unexecuted instantiation: count-objects.c:strbuf_git_path
Unexecuted instantiation: credential-cache.c:strbuf_git_path
Unexecuted instantiation: credential-store.c:strbuf_git_path
Unexecuted instantiation: fast-import.c:strbuf_git_path
Unexecuted instantiation: fetch.c:strbuf_git_path
Unexecuted instantiation: for-each-repo.c:strbuf_git_path
Unexecuted instantiation: fsck.c:strbuf_git_path
Unexecuted instantiation: gc.c:strbuf_git_path
Unexecuted instantiation: grep.c:strbuf_git_path
Unexecuted instantiation: help.c:strbuf_git_path
Unexecuted instantiation: init-db.c:strbuf_git_path
Unexecuted instantiation: ls-files.c:strbuf_git_path
Unexecuted instantiation: ls-tree.c:strbuf_git_path
Unexecuted instantiation: merge.c:strbuf_git_path
Unexecuted instantiation: notes.c:strbuf_git_path
Unexecuted instantiation: prune.c:strbuf_git_path
Unexecuted instantiation: pull.c:strbuf_git_path
Unexecuted instantiation: rebase.c:strbuf_git_path
Unexecuted instantiation: receive-pack.c:strbuf_git_path
Unexecuted instantiation: remote.c:strbuf_git_path
Unexecuted instantiation: repack.c:strbuf_git_path
Unexecuted instantiation: replace.c:strbuf_git_path
Unexecuted instantiation: reset.c:strbuf_git_path
Unexecuted instantiation: rev-parse.c:strbuf_git_path
Unexecuted instantiation: submodule--helper.c:strbuf_git_path
Unexecuted instantiation: tag.c:strbuf_git_path
Unexecuted instantiation: upload-archive.c:strbuf_git_path
Unexecuted instantiation: upload-pack.c:strbuf_git_path
Unexecuted instantiation: var.c:strbuf_git_path
Unexecuted instantiation: worktree.c:strbuf_git_path
Unexecuted instantiation: apply.c:strbuf_git_path
Unexecuted instantiation: archive.c:strbuf_git_path
Unexecuted instantiation: attr.c:strbuf_git_path
Unexecuted instantiation: blame.c:strbuf_git_path
Unexecuted instantiation: commit-graph.c:strbuf_git_path
Unexecuted instantiation: connect.c:strbuf_git_path
Unexecuted instantiation: dir.c:strbuf_git_path
Unexecuted instantiation: editor.c:strbuf_git_path
Unexecuted instantiation: environment.c:strbuf_git_path
Unexecuted instantiation: fetch-pack.c:strbuf_git_path
Unexecuted instantiation: gpg-interface.c:strbuf_git_path
Unexecuted instantiation: merge-ort.c:strbuf_git_path
Unexecuted instantiation: merge-recursive.c:strbuf_git_path
Unexecuted instantiation: midx-write.c:strbuf_git_path
Unexecuted instantiation: notes-merge.c:strbuf_git_path
Unexecuted instantiation: object-file.c:strbuf_git_path
Unexecuted instantiation: pack-bitmap-write.c:strbuf_git_path
Unexecuted instantiation: pack-write.c:strbuf_git_path
Unexecuted instantiation: read-cache.c:strbuf_git_path
Unexecuted instantiation: refs.c:strbuf_git_path
Unexecuted instantiation: reftable-backend.c:strbuf_git_path
Unexecuted instantiation: rerere.c:strbuf_git_path
Unexecuted instantiation: revision.c:strbuf_git_path
Unexecuted instantiation: sequencer.c:strbuf_git_path
Unexecuted instantiation: server-info.c:strbuf_git_path
Unexecuted instantiation: setup.c:strbuf_git_path
Unexecuted instantiation: shallow.c:strbuf_git_path
Unexecuted instantiation: submodule-config.c:strbuf_git_path
Unexecuted instantiation: submodule.c:strbuf_git_path
Unexecuted instantiation: tmp-objdir.c:strbuf_git_path
Unexecuted instantiation: wt-status.c:strbuf_git_path
Unexecuted instantiation: loose.c:strbuf_git_path
274
275
/*
276
 * Return a statically allocated path into the main repository's
277
 * (the_repository) git directory.
278
 */
279
__attribute__((format (printf, 1, 2)))
280
static inline const char *git_path(const char *fmt, ...)
281
0
{
282
0
  struct strbuf *pathname = get_pathname();
283
0
  va_list args;
284
0
  va_start(args, fmt);
285
0
  repo_git_pathv(the_repository, NULL, pathname, fmt, args);
286
0
  va_end(args);
287
0
  return pathname->buf;
288
0
}
Unexecuted instantiation: add.c:git_path
Unexecuted instantiation: am.c:git_path
Unexecuted instantiation: bisect.c:git_path
Unexecuted instantiation: branch.c:git_path
Unexecuted instantiation: checkout.c:git_path
Unexecuted instantiation: clean.c:git_path
Unexecuted instantiation: clone.c:git_path
Unexecuted instantiation: commit.c:git_path
Unexecuted instantiation: config.c:git_path
Unexecuted instantiation: count-objects.c:git_path
Unexecuted instantiation: credential-cache.c:git_path
Unexecuted instantiation: credential-store.c:git_path
Unexecuted instantiation: fast-import.c:git_path
Unexecuted instantiation: fetch.c:git_path
Unexecuted instantiation: for-each-repo.c:git_path
Unexecuted instantiation: fsck.c:git_path
Unexecuted instantiation: gc.c:git_path
Unexecuted instantiation: grep.c:git_path
Unexecuted instantiation: help.c:git_path
Unexecuted instantiation: init-db.c:git_path
Unexecuted instantiation: ls-files.c:git_path
Unexecuted instantiation: ls-tree.c:git_path
Unexecuted instantiation: merge.c:git_path
Unexecuted instantiation: notes.c:git_path
Unexecuted instantiation: prune.c:git_path
Unexecuted instantiation: pull.c:git_path
Unexecuted instantiation: rebase.c:git_path
Unexecuted instantiation: receive-pack.c:git_path
Unexecuted instantiation: remote.c:git_path
Unexecuted instantiation: repack.c:git_path
Unexecuted instantiation: replace.c:git_path
Unexecuted instantiation: reset.c:git_path
Unexecuted instantiation: rev-parse.c:git_path
Unexecuted instantiation: submodule--helper.c:git_path
Unexecuted instantiation: tag.c:git_path
Unexecuted instantiation: upload-archive.c:git_path
Unexecuted instantiation: upload-pack.c:git_path
Unexecuted instantiation: var.c:git_path
Unexecuted instantiation: worktree.c:git_path
Unexecuted instantiation: apply.c:git_path
Unexecuted instantiation: archive.c:git_path
Unexecuted instantiation: attr.c:git_path
Unexecuted instantiation: blame.c:git_path
Unexecuted instantiation: commit-graph.c:git_path
Unexecuted instantiation: connect.c:git_path
Unexecuted instantiation: dir.c:git_path
Unexecuted instantiation: editor.c:git_path
Unexecuted instantiation: environment.c:git_path
Unexecuted instantiation: fetch-pack.c:git_path
Unexecuted instantiation: gpg-interface.c:git_path
Unexecuted instantiation: merge-ort.c:git_path
Unexecuted instantiation: merge-recursive.c:git_path
Unexecuted instantiation: midx-write.c:git_path
Unexecuted instantiation: notes-merge.c:git_path
Unexecuted instantiation: object-file.c:git_path
Unexecuted instantiation: pack-bitmap-write.c:git_path
Unexecuted instantiation: pack-write.c:git_path
Unexecuted instantiation: read-cache.c:git_path
Unexecuted instantiation: refs.c:git_path
Unexecuted instantiation: reftable-backend.c:git_path
Unexecuted instantiation: rerere.c:git_path
Unexecuted instantiation: revision.c:git_path
Unexecuted instantiation: sequencer.c:git_path
Unexecuted instantiation: server-info.c:git_path
Unexecuted instantiation: setup.c:git_path
Unexecuted instantiation: shallow.c:git_path
Unexecuted instantiation: submodule-config.c:git_path
Unexecuted instantiation: submodule.c:git_path
Unexecuted instantiation: tmp-objdir.c:git_path
Unexecuted instantiation: wt-status.c:git_path
Unexecuted instantiation: loose.c:git_path
289
290
#define GIT_PATH_FUNC(func, filename) \
291
  const char *func(void) \
292
73.6k
  { \
293
73.6k
    static char *ret; \
294
73.6k
    if (!ret) \
295
73.6k
      ret = git_pathdup(filename); \
296
73.6k
    return ret; \
297
73.6k
  }
Unexecuted instantiation: bisect.c:git_path_bisect_start
Unexecuted instantiation: bisect.c:git_path_bisect_first_parent
Unexecuted instantiation: bisect.c:git_path_bisect_names
Unexecuted instantiation: bisect.c:git_path_bisect_log
Unexecuted instantiation: bisect.c:git_path_bisect_terms
Unexecuted instantiation: bisect.c:git_path_bisect_run
Unexecuted instantiation: bisect.c:git_path_bisect_ancestors_ok
Unexecuted instantiation: branch.c:edit_description
Unexecuted instantiation: rebase.c:apply_dir
Unexecuted instantiation: rebase.c:merge_dir
Unexecuted instantiation: rebase.c:path_interactive
Unexecuted instantiation: rebase.c:path_squash_onto
attr.c:git_path_info_attributes
Line
Count
Source
292
2
  { \
293
2
    static char *ret; \
294
2
    if (!ret) \
295
2
      ret = git_pathdup(filename); \
296
2
    return ret; \
297
2
  }
dir.c:git_path_info_exclude
Line
Count
Source
292
28.0k
  { \
293
28.0k
    static char *ret; \
294
28.0k
    if (!ret) \
295
28.0k
      ret = git_pathdup(filename); \
296
28.0k
    return ret; \
297
28.0k
  }
rerere.c:git_path_rr_cache
Line
Count
Source
292
9.08k
  { \
293
9.08k
    static char *ret; \
294
9.08k
    if (!ret) \
295
9.08k
      ret = git_pathdup(filename); \
296
9.08k
    return ret; \
297
9.08k
  }
git_path_commit_editmsg
Line
Count
Source
292
36.4k
  { \
293
36.4k
    static char *ret; \
294
36.4k
    if (!ret) \
295
36.4k
      ret = git_pathdup(filename); \
296
36.4k
    return ret; \
297
36.4k
  }
Unexecuted instantiation: rebase_path_todo
Unexecuted instantiation: rebase_path_todo_backup
Unexecuted instantiation: rebase_path_dropped
Unexecuted instantiation: sequencer.c:rebase_path_refs_to_delete
sequencer.c:git_path_todo_file
Line
Count
Source
292
82
  { \
293
82
    static char *ret; \
294
82
    if (!ret) \
295
82
      ret = git_pathdup(filename); \
296
82
    return ret; \
297
82
  }
Unexecuted instantiation: sequencer.c:rebase_path_done
Unexecuted instantiation: sequencer.c:rebase_path_head_name
Unexecuted instantiation: sequencer.c:rebase_path_onto
Unexecuted instantiation: sequencer.c:rebase_path_orig_head
Unexecuted instantiation: sequencer.c:rebase_path_quiet
Unexecuted instantiation: sequencer.c:rebase_path_verbose
Unexecuted instantiation: sequencer.c:rebase_path_strategy
Unexecuted instantiation: sequencer.c:rebase_path_strategy_opts
Unexecuted instantiation: sequencer.c:rebase_path_allow_rerere_autoupdate
Unexecuted instantiation: sequencer.c:rebase_path_gpg_sign_opt
Unexecuted instantiation: sequencer.c:rebase_path_signoff
Unexecuted instantiation: sequencer.c:rebase_path_drop_redundant_commits
Unexecuted instantiation: sequencer.c:rebase_path_keep_redundant_commits
Unexecuted instantiation: sequencer.c:rebase_path_cdate_is_adate
Unexecuted instantiation: sequencer.c:rebase_path_ignore_date
Unexecuted instantiation: sequencer.c:rebase_path_reschedule_failed_exec
Unexecuted instantiation: sequencer.c:rebase_path_no_reschedule_failed_exec
Unexecuted instantiation: sequencer.c:git_path_head_file
Unexecuted instantiation: sequencer.c:git_path_abort_safety_file
Unexecuted instantiation: sequencer.c:git_path_seq_dir
Unexecuted instantiation: sequencer.c:rebase_path_current_fixups
Unexecuted instantiation: sequencer.c:rebase_path_squash_onto
Unexecuted instantiation: sequencer.c:git_path_opts_file
Unexecuted instantiation: sequencer.c:rebase_path_message
Unexecuted instantiation: sequencer.c:rebase_path_amend
Unexecuted instantiation: sequencer.c:rebase_path_fixup_msg
Unexecuted instantiation: sequencer.c:rebase_path_squash_msg
Unexecuted instantiation: sequencer.c:rebase_path_author_script
Unexecuted instantiation: sequencer.c:rebase_path_stopped_sha
Unexecuted instantiation: sequencer.c:rebase_path_rewritten_pending
Unexecuted instantiation: sequencer.c:rebase_path_rewritten_list
Unexecuted instantiation: sequencer.c:rebase_path_patch
Unexecuted instantiation: sequencer.c:rebase_path_msgnum
Unexecuted instantiation: sequencer.c:rebase_path_autostash
Unexecuted instantiation: sequencer.c:rebase_path_msgtotal
Unexecuted instantiation: sequencer.c:rebase_path
298
299
/*
300
 * Return a path into the main repository's (the_repository) git directory.
301
 */
302
__attribute__((format (printf, 1, 2)))
303
static inline char *git_pathdup(const char *fmt, ...)
304
5
{
305
5
  struct strbuf path = STRBUF_INIT;
306
5
  va_list args;
307
5
  va_start(args, fmt);
308
5
  repo_git_pathv(the_repository, NULL, &path, fmt, args);
309
5
  va_end(args);
310
5
  return strbuf_detach(&path, NULL);
311
5
}
Unexecuted instantiation: add.c:git_pathdup
Unexecuted instantiation: am.c:git_pathdup
Unexecuted instantiation: bisect.c:git_pathdup
Unexecuted instantiation: branch.c:git_pathdup
Unexecuted instantiation: checkout.c:git_pathdup
Unexecuted instantiation: clean.c:git_pathdup
Unexecuted instantiation: clone.c:git_pathdup
Unexecuted instantiation: commit.c:git_pathdup
Unexecuted instantiation: config.c:git_pathdup
Unexecuted instantiation: count-objects.c:git_pathdup
Unexecuted instantiation: credential-cache.c:git_pathdup
Unexecuted instantiation: credential-store.c:git_pathdup
Unexecuted instantiation: fast-import.c:git_pathdup
Unexecuted instantiation: fetch.c:git_pathdup
Unexecuted instantiation: for-each-repo.c:git_pathdup
Unexecuted instantiation: fsck.c:git_pathdup
Unexecuted instantiation: gc.c:git_pathdup
Unexecuted instantiation: grep.c:git_pathdup
Unexecuted instantiation: help.c:git_pathdup
Unexecuted instantiation: init-db.c:git_pathdup
Unexecuted instantiation: ls-files.c:git_pathdup
Unexecuted instantiation: ls-tree.c:git_pathdup
Unexecuted instantiation: merge.c:git_pathdup
Unexecuted instantiation: notes.c:git_pathdup
Unexecuted instantiation: prune.c:git_pathdup
Unexecuted instantiation: pull.c:git_pathdup
Unexecuted instantiation: rebase.c:git_pathdup
Unexecuted instantiation: receive-pack.c:git_pathdup
Unexecuted instantiation: remote.c:git_pathdup
Unexecuted instantiation: repack.c:git_pathdup
Unexecuted instantiation: replace.c:git_pathdup
Unexecuted instantiation: reset.c:git_pathdup
Unexecuted instantiation: rev-parse.c:git_pathdup
Unexecuted instantiation: submodule--helper.c:git_pathdup
Unexecuted instantiation: tag.c:git_pathdup
Unexecuted instantiation: upload-archive.c:git_pathdup
Unexecuted instantiation: upload-pack.c:git_pathdup
Unexecuted instantiation: var.c:git_pathdup
Unexecuted instantiation: worktree.c:git_pathdup
Unexecuted instantiation: apply.c:git_pathdup
Unexecuted instantiation: archive.c:git_pathdup
attr.c:git_pathdup
Line
Count
Source
304
1
{
305
1
  struct strbuf path = STRBUF_INIT;
306
1
  va_list args;
307
1
  va_start(args, fmt);
308
1
  repo_git_pathv(the_repository, NULL, &path, fmt, args);
309
1
  va_end(args);
310
1
  return strbuf_detach(&path, NULL);
311
1
}
Unexecuted instantiation: blame.c:git_pathdup
Unexecuted instantiation: commit-graph.c:git_pathdup
Unexecuted instantiation: connect.c:git_pathdup
dir.c:git_pathdup
Line
Count
Source
304
1
{
305
1
  struct strbuf path = STRBUF_INIT;
306
1
  va_list args;
307
1
  va_start(args, fmt);
308
1
  repo_git_pathv(the_repository, NULL, &path, fmt, args);
309
1
  va_end(args);
310
1
  return strbuf_detach(&path, NULL);
311
1
}
Unexecuted instantiation: editor.c:git_pathdup
Unexecuted instantiation: environment.c:git_pathdup
Unexecuted instantiation: fetch-pack.c:git_pathdup
Unexecuted instantiation: gpg-interface.c:git_pathdup
Unexecuted instantiation: merge-ort.c:git_pathdup
Unexecuted instantiation: merge-recursive.c:git_pathdup
Unexecuted instantiation: midx-write.c:git_pathdup
Unexecuted instantiation: notes-merge.c:git_pathdup
Unexecuted instantiation: object-file.c:git_pathdup
Unexecuted instantiation: pack-bitmap-write.c:git_pathdup
Unexecuted instantiation: pack-write.c:git_pathdup
Unexecuted instantiation: read-cache.c:git_pathdup
Unexecuted instantiation: refs.c:git_pathdup
Unexecuted instantiation: reftable-backend.c:git_pathdup
rerere.c:git_pathdup
Line
Count
Source
304
1
{
305
1
  struct strbuf path = STRBUF_INIT;
306
1
  va_list args;
307
1
  va_start(args, fmt);
308
1
  repo_git_pathv(the_repository, NULL, &path, fmt, args);
309
1
  va_end(args);
310
1
  return strbuf_detach(&path, NULL);
311
1
}
Unexecuted instantiation: revision.c:git_pathdup
sequencer.c:git_pathdup
Line
Count
Source
304
2
{
305
2
  struct strbuf path = STRBUF_INIT;
306
2
  va_list args;
307
2
  va_start(args, fmt);
308
2
  repo_git_pathv(the_repository, NULL, &path, fmt, args);
309
2
  va_end(args);
310
2
  return strbuf_detach(&path, NULL);
311
2
}
Unexecuted instantiation: server-info.c:git_pathdup
Unexecuted instantiation: setup.c:git_pathdup
Unexecuted instantiation: shallow.c:git_pathdup
Unexecuted instantiation: submodule-config.c:git_pathdup
Unexecuted instantiation: submodule.c:git_pathdup
Unexecuted instantiation: tmp-objdir.c:git_pathdup
Unexecuted instantiation: wt-status.c:git_pathdup
Unexecuted instantiation: loose.c:git_pathdup
312
313
# endif /* USE_THE_REPOSITORY_VARIABLE */
314
315
#endif /* PATH_H */