Skip to content

Commit 5eb48a1

Browse files
committed
strarray: deprecate git_strarray_copy
We should not be in the business of copying strings around for users. We either return a strarray that can be freed, or we take one (and do not mutate it).
1 parent 51eff5a commit 5eb48a1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

include/git2/deprecated.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,18 @@ typedef int GIT_CALLBACK(git_headlist_cb)(git_remote_head *rhead, void *payload)
534534
*/
535535
/**@{*/
536536

537+
/**
538+
* Copy a string array object from source to target.
539+
*
540+
* This function is deprecated, but there is no plan to remove this
541+
* function at this time.
542+
*
543+
* @param tgt target
544+
* @param src source
545+
* @return 0 on success, < 0 on allocation failure
546+
*/
547+
GIT_EXTERN(int) git_strarray_copy(git_strarray *tgt, const git_strarray *src);
548+
537549
/**
538550
* Free the memory referred to by the git_strarray. This is an alias of
539551
* `git_strarray_dispose` and is preserved for backward compatibility.

0 commit comments

Comments
 (0)