Skip to content

Commit

Permalink
Merge pull request #6486 from libgit2/ethomson/strarray-deprecate
Browse files Browse the repository at this point in the history
  • Loading branch information
ethomson committed Feb 16, 2023
2 parents cefe6c4 + 7c6df9e commit 7108b43
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 14 deletions.
13 changes: 0 additions & 13 deletions include/git2/strarray.h
Expand Up @@ -36,19 +36,6 @@ typedef struct git_strarray {
*/
GIT_EXTERN(void) git_strarray_dispose(git_strarray *array);

/**
* Copy a string array object from source to target.
*
* Note: target is overwritten and hence should be empty, otherwise its
* contents are leaked. Call git_strarray_free() if necessary.
*
* @param tgt target
* @param src source
* @return 0 on success, < 0 on allocation failure
*/
GIT_EXTERN(int) git_strarray_copy(git_strarray *tgt, const git_strarray *src);


/** @} */
GIT_END_DECL

Expand Down
2 changes: 1 addition & 1 deletion src/libgit2/describe.c
Expand Up @@ -8,7 +8,6 @@
#include "common.h"

#include "git2/describe.h"
#include "git2/strarray.h"
#include "git2/diff.h"
#include "git2/status.h"

Expand All @@ -19,6 +18,7 @@
#include "refs.h"
#include "repository.h"
#include "revwalk.h"
#include "strarray.h"
#include "tag.h"
#include "vector.h"
#include "wildmatch.h"
Expand Down
1 change: 1 addition & 0 deletions src/libgit2/remote.c
Expand Up @@ -17,6 +17,7 @@
#include "fetchhead.h"
#include "push.h"
#include "proxy.h"
#include "strarray.h"

#include "git2/config.h"
#include "git2/types.h"
Expand Down
1 change: 1 addition & 0 deletions src/libgit2/strarray.c
Expand Up @@ -8,6 +8,7 @@
#include "util.h"

#include "common.h"
#include "strarray.h"

int git_strarray_copy(git_strarray *tgt, const git_strarray *src)
{
Expand Down
25 changes: 25 additions & 0 deletions src/libgit2/strarray.h
@@ -0,0 +1,25 @@
/*
* Copyright (C) the libgit2 contributors. All rights reserved.
*
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
#ifndef INCLUDE_strarray_h__
#define INCLUDE_strarray_h__

#include "common.h"
#include "git2/strarray.h"

/**
* Copy a string array object from source to target.
*
* Note: target is overwritten and hence should be empty, otherwise its
* contents are leaked. Call git_strarray_free() if necessary.
*
* @param tgt target
* @param src source
* @return 0 on success, < 0 on allocation failure
*/
extern int git_strarray_copy(git_strarray *tgt, const git_strarray *src);

#endif

0 comments on commit 7108b43

Please sign in to comment.