Skip to content

Commit c7143d7

Browse files
committed
remote: deprecate git_remote_is_valid_name
1 parent 55a7117 commit c7143d7

File tree

3 files changed

+35
-16
lines changed

3 files changed

+35
-16
lines changed

include/git2/deprecated.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,27 @@ GIT_EXTERN(size_t) git_object__size(git_object_t type);
340340

341341
/**@}*/
342342

343+
/** @name Deprecated Remote Functions
344+
*
345+
* These functions are retained for backward compatibility. The newer
346+
* versions of these functions should be preferred in all new code.
347+
*
348+
* There is no plan to remove these backward compatibility functions at
349+
* this time.
350+
*/
351+
/**@{*/
352+
353+
/**
354+
* Ensure the remote name is well-formed.
355+
*
356+
* @deprecated Use git_remote_name_is_valid
357+
* @param remote_name name to be checked.
358+
* @return 1 if the reference name is acceptable; 0 if it isn't
359+
*/
360+
GIT_EXTERN(int) git_remote_is_valid_name(const char *remote_name);
361+
362+
/**@}*/
363+
343364
/** @name Deprecated Reference Functions and Constants
344365
*
345366
* These functions and enumeration values are retained for backward

include/git2/remote.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -921,14 +921,6 @@ GIT_EXTERN(int) git_remote_rename(
921921
*/
922922
int git_remote_name_is_valid(int *valid, const char *remote_name);
923923

924-
/**
925-
* Ensure the remote name is well-formed.
926-
*
927-
* @param remote_name name to be checked.
928-
* @return 1 if the reference name is acceptable; 0 if it isn't
929-
*/
930-
GIT_EXTERN(int) git_remote_is_valid_name(const char *remote_name);
931-
932924
/**
933925
* Delete an existing persisted remote.
934926
*

src/remote.c

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2124,14 +2124,6 @@ int git_remote_name_is_valid(int *valid, const char *remote_name)
21242124
return error;
21252125
}
21262126

2127-
int git_remote_is_valid_name(const char *remote_name)
2128-
{
2129-
int valid = 0;
2130-
2131-
git_remote_name_is_valid(&valid, remote_name);
2132-
return valid;
2133-
}
2134-
21352127
git_refspec *git_remote__matching_refspec(git_remote *remote, const char *refname)
21362128
{
21372129
git_refspec *spec;
@@ -2628,3 +2620,17 @@ char *apply_insteadof(git_config *config, const char *url, int direction)
26282620

26292621
return result.ptr;
26302622
}
2623+
2624+
/* Deprecated functions */
2625+
2626+
#ifndef GIT_DEPRECATE_HARD
2627+
2628+
int git_remote_is_valid_name(const char *remote_name)
2629+
{
2630+
int valid = 0;
2631+
2632+
git_remote_name_is_valid(&valid, remote_name);
2633+
return valid;
2634+
}
2635+
2636+
#endif

0 commit comments

Comments
 (0)