]> git.proxmox.com Git - libgit2.git/blobdiff - src/describe.c
New upstream version 1.3.0+dfsg.1
[libgit2.git] / src / describe.c
index 8beffdebaa68a89f5503bf5b1f551c2a6ec3d445..103d0da5c8d212f39c831e46c11e9d608c54de28 100644 (file)
@@ -391,7 +391,7 @@ static int show_suffix(
        git_buf *buf,
        int depth,
        git_repository *repo,
-       const git_oidid,
+       const git_oid *id,
        unsigned int abbrev_size)
 {
        int error, size = 0;
@@ -655,7 +655,8 @@ int git_describe_commit(
        int error = -1;
        git_describe_options normalized;
 
-       assert(committish);
+       GIT_ASSERT_ARG(result);
+       GIT_ASSERT_ARG(committish);
 
        data.result = git__calloc(1, sizeof(git_describe_result));
        GIT_ERROR_CHECK_ALLOC(data.result);
@@ -775,12 +776,14 @@ int git_describe_format(git_buf *out, const git_describe_result *result, const g
        struct commit_name *name;
        git_describe_format_options opts;
 
-       assert(out && result);
+       GIT_ASSERT_ARG(out);
+       GIT_ASSERT_ARG(result);
 
        GIT_ERROR_CHECK_VERSION(given, GIT_DESCRIBE_FORMAT_OPTIONS_VERSION, "git_describe_format_options");
        normalize_format_options(&opts, given);
 
-       git_buf_sanitize(out);
+       if ((error = git_buf_sanitize(out)) < 0)
+               return error;
 
 
        if (opts.always_use_long_format && opts.abbreviated_size == 0) {