Commit b0aa14aa3c1fff7bb585df5e06e23588fb829bf6

nulltoken 2012-12-24T15:27:42

remote: Enhance in-memory remote test coverage

diff --git a/include/git2/remote.h b/include/git2/remote.h
index 319976f..4397154 100644
--- a/include/git2/remote.h
+++ b/include/git2/remote.h
@@ -109,7 +109,7 @@ GIT_EXTERN(int) git_remote_save(const git_remote *remote);
  * Get the remote's name
  *
  * @param remote the remote
- * @return a pointer to the name
+ * @return a pointer to the name or NULL for in-memory remotes
  */
 GIT_EXTERN(const char *) git_remote_name(const git_remote *remote);
 
diff --git a/tests-clar/network/remotes.c b/tests-clar/network/remotes.c
index 53681f9..26558f2 100644
--- a/tests-clar/network/remotes.c
+++ b/tests-clar/network/remotes.c
@@ -257,6 +257,8 @@ void test_network_remotes__cannot_save_an_inmemory_remote(void)
 
 	cl_git_pass(git_remote_create_inmemory(&remote, _repo, "git://github.com/libgit2/libgit2", NULL));
 
+	cl_assert_equal_p(NULL, git_remote_name(remote));
+
 	cl_git_fail(git_remote_save(remote));
 	git_remote_free(remote);
 }