diff options
| author | Carlos Martín Nieto <cmn@dwim.me> | 2015-05-17 15:19:22 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <cmn@dwim.me> | 2015-05-28 15:32:20 +0200 |
| commit | c6e942fb3d10d9f8f2e22833ddddbd945c0d6604 (patch) | |
| tree | d5257c00aaa122fc73bcd0d9e496c1c63fa36a56 /include/git2 | |
| parent | ae5b93629c148dc96de7337095fba4b1e901ee2b (diff) | |
| download | libgit2-c6e942fb3d10d9f8f2e22833ddddbd945c0d6604.tar.gz | |
remote: validate refspecs before adding to config
When we moved from acting on the instance to acting on the
configuration, we dropped the validation of the passed refspec, which
can lead to writing an invalid refspec to the configuration. Bring that
validation back.
Diffstat (limited to 'include/git2')
| -rw-r--r-- | include/git2/remote.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/git2/remote.h b/include/git2/remote.h index 86498a31a..577a1c853 100644 --- a/include/git2/remote.h +++ b/include/git2/remote.h @@ -168,7 +168,7 @@ GIT_EXTERN(int) git_remote_set_pushurl(git_repository *repo, const char *remote, * @param repo the repository in which to change the configuration * @param remote the name of the remote to change * @param refspec the new fetch refspec - * @return 0 or an error value + * @return 0, GIT_EINVALIDSPEC if refspec is invalid or an error value */ GIT_EXTERN(int) git_remote_add_fetch(git_repository *repo, const char *remote, const char *refspec); @@ -192,7 +192,7 @@ GIT_EXTERN(int) git_remote_get_fetch_refspecs(git_strarray *array, const git_rem * @param repo the repository in which to change the configuration * @param remote the name of the remote to change * @param refspec the new push refspec - * @return 0 or an error value + * @return 0, GIT_EINVALIDSPEC if refspec is invalid or an error value */ GIT_EXTERN(int) git_remote_add_push(git_repository *repo, const char *remote, const char *refspec); |
