Skip to content

Commit a18b4bd

Browse files
committed
refspec.c: make valid_fetch_refspec() file-scope static
f2c6fda (refs: consolidate remote name validation, 2020-10-01) moved valid_remote_name(), which receives the name the user gave to "git remote add <name>" and checks if it is a name that we allow to name a remote, to this file, even though it would have been a better fit in remote.c file. The function was the only caller of the helper function valid_fetch_refspec() defined in this file, and in the 4 years or so since then, we have not added any new callers to the latter. It could be argued that we should move valid_remote_name() to remote.c someday, which would make it necessary for this function to be public, but it is simpler to let the caller to stay there and reduce the number of public functions by one. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 79ff57f commit a18b4bd

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

refspec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ void refspec_clear(struct refspec *rs)
233233
rs->fetch = 0;
234234
}
235235

236-
int valid_fetch_refspec(const char *fetch_refspec_str)
236+
static int valid_fetch_refspec(const char *fetch_refspec_str)
237237
{
238238
struct refspec_item refspec;
239239
int ret = refspec_item_init(&refspec, fetch_refspec_str, REFSPEC_FETCH);

refspec.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ void refspec_appendf(struct refspec *rs, const char *fmt, ...);
6262
void refspec_appendn(struct refspec *rs, const char **refspecs, int nr);
6363
void refspec_clear(struct refspec *rs);
6464

65-
int valid_fetch_refspec(const char *refspec);
6665
int valid_remote_name(const char *name);
6766

6867
struct strvec;

0 commit comments

Comments
 (0)