Skip to content

Commit

Permalink
Make git_remote_supported_url() public and shorten error string
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosmn committed Mar 5, 2012
1 parent 7a54496 commit 4f8efc9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 8 additions & 0 deletions include/git2/remote.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,14 @@ GIT_EXTERN(int) git_remote_update_tips(git_remote *remote);
*/
GIT_EXTERN(int) git_remote_valid_url(const char *url);

/**
* Return whether the passed URL is supported by this version of the library.
*
* @param url the url to check
* @return 1 if the url is supported, 0 otherwise
*/
GIT_EXTERN(int) git_remote_supported_url(const char* url);

/**
* Get a list of the configured remotes for a repo
*
Expand Down
3 changes: 1 addition & 2 deletions src/transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "git2/net.h"
#include "transport.h"
#include "path.h"
#include <regex.h>

static struct {
char *prefix;
Expand Down Expand Up @@ -67,7 +66,7 @@ int git_transport_new(git_transport **out, const char *url)
fn = transport_find_fn(url);

if (fn == NULL)
return git__throw(GIT_EINVALIDARGS, "No supported transport mechanism found for URL or path. Either libgit2 has not implemented this transport protocol, or it can not find the specified path.");
return git__throw(GIT_EINVALIDARGS, "Unsupported URL or non-existent path");

error = fn(&transport);
if (error < GIT_SUCCESS)
Expand Down
7 changes: 0 additions & 7 deletions src/transport.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,6 @@ int git_transport_dummy(struct git_transport **transport);
*/
int git_transport_valid_url(const char *url);

/**
Returns true if the passed URL is supported by this version of libgit2.
(or, more technically, the transport method inferred by libgit is supported
by this version of libgit2).
*/
int git_remote_supported_url(const char* url);

typedef struct git_transport git_transport;
typedef int (*git_transport_cb)(git_transport **transport);

Expand Down

0 comments on commit 4f8efc9

Please sign in to comment.