return !!server_feature_value(feature, NULL);
}
-enum url_scheme {
- URL_SCHEME_LOCAL = 1,
- URL_SCHEME_FILE,
- URL_SCHEME_SSH,
- URL_SCHEME_GIT
-};
-
static const char *url_scheme_name(enum url_scheme scheme)
{
switch (scheme) {
}
}
-static enum url_scheme url_get_scheme(const char *name)
-{
- if (!strcmp(name, "ssh"))
- return URL_SCHEME_SSH;
- if (!strcmp(name, "git"))
- return URL_SCHEME_GIT;
- if (!strcmp(name, "git+ssh")) /* deprecated - do not use */
- return URL_SCHEME_SSH;
- if (!strcmp(name, "ssh+git")) /* deprecated - do not use */
- return URL_SCHEME_SSH;
- if (!strcmp(name, "file"))
- return URL_SCHEME_FILE;
- die(_("protocol '%s' is not supported"), name);
-}
-
static char *host_end(char **hoststart, int removebrackets)
{
char *host = *hoststart;
#include "git-compat-util.h"
+#include "gettext.h"
#include "hex-ll.h"
#include "strbuf.h"
#include "url.h"
return !colon || (slash && slash < colon) ||
(has_dos_drive_prefix(url) && is_valid_path(url));
}
+
+enum url_scheme url_get_scheme(const char *name)
+{
+ if (!strcmp(name, "ssh"))
+ return URL_SCHEME_SSH;
+ if (!strcmp(name, "git"))
+ return URL_SCHEME_GIT;
+ if (!strcmp(name, "git+ssh")) /* deprecated - do not use */
+ return URL_SCHEME_SSH;
+ if (!strcmp(name, "ssh+git")) /* deprecated - do not use */
+ return URL_SCHEME_SSH;
+ if (!strcmp(name, "file"))
+ return URL_SCHEME_FILE;
+ die(_("protocol '%s' is not supported"), name);
+}
int url_is_local_not_ssh(const char *url);
+enum url_scheme {
+ URL_SCHEME_LOCAL = 1,
+ URL_SCHEME_FILE,
+ URL_SCHEME_SSH,
+ URL_SCHEME_GIT,
+};
+
+/*
+ * Identify the URL scheme by name. Dies if the name does not match
+ * any scheme that Git knows about.
+ */
+enum url_scheme url_get_scheme(const char *name);
+
/*
* The set of unreserved characters as per STD66 (RFC3986) is
* '[A-Za-z0-9-._~]'. These characters are safe to appear in URI