summaryrefslogtreecommitdiff
path: root/tests/submodule/submodule_helpers.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-05-04 17:09:21 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2015-06-22 17:02:55 +0200
commit64bbd47a32e6aaed539bafd109eef624f24fbae7 (patch)
tree041d8dedeb30610522d413e424abd2ea6c4d17c3 /tests/submodule/submodule_helpers.c
parent5a9fc6c83c2fd12ce312d1042ec2c1e6abad4033 (diff)
downloadlibgit2-64bbd47a32e6aaed539bafd109eef624f24fbae7.tar.gz
submodule: don't let status change an existing instance
As submodules are becomes more like values, we should not let a status check to update its properties. Instead of taking a submodule, have status take a repo and submodule name.
Diffstat (limited to 'tests/submodule/submodule_helpers.c')
-rw-r--r--tests/submodule/submodule_helpers.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/submodule/submodule_helpers.c b/tests/submodule/submodule_helpers.c
index 19bb04f75..36838228f 100644
--- a/tests/submodule/submodule_helpers.c
+++ b/tests/submodule/submodule_helpers.c
@@ -164,13 +164,11 @@ void refute__submodule_exists(
unsigned int get_submodule_status(git_repository *repo, const char *name)
{
- git_submodule *sm = NULL;
unsigned int status = 0;
- cl_git_pass(git_submodule_lookup(&sm, repo, name));
- cl_assert(sm);
- cl_git_pass(git_submodule_status(&status, sm));
- git_submodule_free(sm);
+ assert(repo && name);
+
+ cl_git_pass(git_submodule_status(&status, repo, name));
return status;
}