Skip to content

Commit bf1616d

Browse files
committed
submodule: git submodule dup implementation has been reverted. Assert has been added.
1 parent 11aa20b commit bf1616d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/submodule.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1856,7 +1856,13 @@ static void submodule_release(git_submodule *sm)
18561856

18571857
int git_submodule_dup(git_submodule **out, git_submodule *source)
18581858
{
1859-
return git_object_dup((git_object **)out, (git_object *)source);
1859+
GIT_ASSERT_ARG(out);
1860+
1861+
if (source != NULL)
1862+
GIT_REFCOUNT_INC(source);
1863+
1864+
*out = source;
1865+
return 0;
18601866
}
18611867

18621868
void git_submodule_free(git_submodule *sm)

0 commit comments

Comments
 (0)