Commit 49f9941d by Dmitry Lobanov

submodule: git submodule dup has been added.

parent be95f684
......@@ -224,6 +224,13 @@ GIT_EXTERN(int) git_submodule_lookup(
const char *name);
/**
* Dup (retain) a submodule
*
* @param submodule Submodule object
*/
GIT_EXTERN(git_submodule *) git_submodule_dup(git_submodule *submodule);
/**
* Release a submodule
*
* @param submodule Submodule object
......
......@@ -1854,6 +1854,14 @@ static void submodule_release(git_submodule *sm)
git__free(sm);
}
git_submodule* git_submodule_dup(git_submodule *sm)
{
if (!sm)
return;
GIT_REFCOUNT_INC(sm);
return sm;
}
void git_submodule_free(git_submodule *sm)
{
if (!sm)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment