Skip to content

Commit 07e3070

Browse files
peffgitster
authored andcommitted
path.c: drop git_path_submodule
There are no callers of the slightly-dangerous static-buffer git_path_submodule left. Let's drop it. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f5b2dec commit 07e3070

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

cache.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -713,12 +713,11 @@ extern int check_repository_format(void);
713713
* the repository directory (git_path), or in a submodule's repository
714714
* directory (git_path_submodule). In all cases, note that the result
715715
* may be overwritten by another call to _any_ of the functions. Consider
716-
* using the safer "dup" or "strbuf" formats below.
716+
* using the safer "dup" or "strbuf" formats below (in some cases, the
717+
* unsafe versions have already been removed).
717718
*/
718719
extern const char *mkpath(const char *fmt, ...) __attribute__((format (printf, 1, 2)));
719720
extern const char *git_path(const char *fmt, ...) __attribute__((format (printf, 1, 2)));
720-
extern const char *git_path_submodule(const char *path, const char *fmt, ...)
721-
__attribute__((format (printf, 2, 3)));
722721

723722
extern char *mksnpath(char *buf, size_t n, const char *fmt, ...)
724723
__attribute__((format (printf, 3, 4)));

path.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -245,16 +245,6 @@ static void do_submodule_path(struct strbuf *buf, const char *path,
245245
strbuf_cleanup_path(buf);
246246
}
247247

248-
const char *git_path_submodule(const char *path, const char *fmt, ...)
249-
{
250-
va_list args;
251-
struct strbuf *buf = get_pathname();
252-
va_start(args, fmt);
253-
do_submodule_path(buf, path, fmt, args);
254-
va_end(args);
255-
return buf->buf;
256-
}
257-
258248
char *git_pathdup_submodule(const char *path, const char *fmt, ...)
259249
{
260250
va_list args;

0 commit comments

Comments
 (0)