Skip to content

Commit 428f1ac

Browse files
committed
submodule: git submodule dup out and source parameters have become mandatory.
1 parent 11452ca commit 428f1ac

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

include/git2/submodule.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ GIT_EXTERN(int) git_submodule_lookup(
227227
* Create an in-memory copy of a submodule. The copy must be explicitly
228228
* free'd or it will leak.
229229
*
230-
* @param out Pointer to store the copy of the submodule. Cannot be NULL.
230+
* @param out Pointer to store the copy of the submodule.
231231
* @param source Original submodule to copy.
232232
*/
233233
GIT_EXTERN(int) git_submodule_dup(git_submodule **out, git_submodule *source);

src/submodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1857,9 +1857,9 @@ static void submodule_release(git_submodule *sm)
18571857
int git_submodule_dup(git_submodule **out, git_submodule *source)
18581858
{
18591859
GIT_ASSERT_ARG(out);
1860+
GIT_ASSERT_ARG(source);
18601861

1861-
if (source != NULL)
1862-
GIT_REFCOUNT_INC(source);
1862+
GIT_REFCOUNT_INC(source);
18631863

18641864
*out = source;
18651865
return 0;

0 commit comments

Comments
 (0)