2 * Copyright (C) the libgit2 contributors. All rights reserved.
4 * This file is part of libgit2, distributed under the GNU GPL v2 with
5 * a Linking Exception. For full terms see the included COPYING file.
7 #ifndef INCLUDE_git_deprecated_h__
8 #define INCLUDE_git_deprecated_h__
16 #include "cherrypick.h"
31 #include "repository.h"
36 #include "submodule.h"
38 #include "credential.h"
39 #include "credential_helpers.h"
42 * Users can avoid deprecated functions by defining `GIT_DEPRECATE_HARD`.
44 #ifndef GIT_DEPRECATE_HARD
47 * The credential structures are now opaque by default, and their
48 * definition has moved into the `sys/credential.h` header; include
49 * them here for backward compatibility.
51 #include "sys/credential.h"
54 * @file git2/deprecated.h
55 * @brief libgit2 deprecated functions and values
61 /** @name Deprecated Attribute Constants
63 * These enumeration values are retained for backward compatibility.
64 * The newer versions of these functions should be preferred in all
67 * There is no plan to remove these backward compatibility values at
72 #define GIT_ATTR_UNSPECIFIED_T GIT_ATTR_VALUE_UNSPECIFIED
73 #define GIT_ATTR_TRUE_T GIT_ATTR_VALUE_TRUE
74 #define GIT_ATTR_FALSE_T GIT_ATTR_VALUE_FALSE
75 #define GIT_ATTR_VALUE_T GIT_ATTR_VALUE_STRING
77 #define GIT_ATTR_TRUE(attr) GIT_ATTR_IS_TRUE(attr)
78 #define GIT_ATTR_FALSE(attr) GIT_ATTR_IS_FALSE(attr)
79 #define GIT_ATTR_UNSPECIFIED(attr) GIT_ATTR_IS_UNSPECIFIED(attr)
81 typedef git_attr_value_t git_attr_t
;
85 /** @name Deprecated Blob Functions and Constants
87 * These functions and enumeration values are retained for backward
88 * compatibility. The newer versions of these functions and values
89 * should be preferred in all new code.
91 * There is no plan to remove these backward compatibility values at
96 #define GIT_BLOB_FILTER_ATTTRIBUTES_FROM_HEAD GIT_BLOB_FILTER_ATTRIBUTES_FROM_HEAD
98 GIT_EXTERN(int) git_blob_create_fromworkdir(git_oid
*id
, git_repository
*repo
, const char *relative_path
);
99 GIT_EXTERN(int) git_blob_create_fromdisk(git_oid
*id
, git_repository
*repo
, const char *path
);
100 GIT_EXTERN(int) git_blob_create_fromstream(
101 git_writestream
**out
,
102 git_repository
*repo
,
103 const char *hintpath
);
104 GIT_EXTERN(int) git_blob_create_fromstream_commit(
106 git_writestream
*stream
);
107 GIT_EXTERN(int) git_blob_create_frombuffer(
108 git_oid
*id
, git_repository
*repo
, const void *buffer
, size_t len
);
110 /** Deprecated in favor of `git_blob_filter`.
112 * @deprecated Use git_blob_filter
113 * @see git_blob_filter
115 GIT_EXTERN(int) git_blob_filtered_content(
119 int check_for_binary_data
);
123 /** @name Deprecated Filter Functions
125 * These functions are retained for backward compatibility. The
126 * newer versions of these functions should be preferred in all
129 * There is no plan to remove these backward compatibility values at
134 /** Deprecated in favor of `git_filter_list_stream_buffer`.
136 * @deprecated Use git_filter_list_stream_buffer
137 * @see Use git_filter_list_stream_buffer
139 GIT_EXTERN(int) git_filter_list_stream_data(
140 git_filter_list
*filters
,
142 git_writestream
*target
);
144 /** Deprecated in favor of `git_filter_list_apply_to_buffer`.
146 * @deprecated Use git_filter_list_apply_to_buffer
147 * @see Use git_filter_list_apply_to_buffer
149 GIT_EXTERN(int) git_filter_list_apply_to_data(
151 git_filter_list
*filters
,
156 /** @name Deprecated Tree Functions
158 * These functions are retained for backward compatibility. The
159 * newer versions of these functions and values should be preferred
162 * There is no plan to remove these backward compatibility values at
168 * Write the contents of the tree builder as a tree object.
169 * This is an alias of `git_treebuilder_write` and is preserved
170 * for backward compatibility.
172 * This function is deprecated, but there is no plan to remove this
173 * function at this time.
175 * @deprecated Use git_treebuilder_write
176 * @see git_treebuilder_write
178 GIT_EXTERN(int) git_treebuilder_write_with_buffer(
179 git_oid
*oid
, git_treebuilder
*bld
, git_buf
*tree
);
183 /** @name Deprecated Buffer Functions
185 * These functions and enumeration values are retained for backward
186 * compatibility. The newer versions of these functions should be
187 * preferred in all new code.
189 * There is no plan to remove these backward compatibility values at
195 * Static initializer for git_buf from static buffer
197 #define GIT_BUF_INIT_CONST(STR,LEN) { (char *)(STR), 0, (size_t)(LEN) }
200 * Resize the buffer allocation to make more space.
202 * This will attempt to grow the buffer to accommodate the target size.
204 * If the buffer refers to memory that was not allocated by libgit2 (i.e.
205 * the `asize` field is zero), then `ptr` will be replaced with a newly
206 * allocated block of data. Be careful so that memory allocated by the
207 * caller is not lost. As a special variant, if you pass `target_size` as
208 * 0 and the memory is not allocated by libgit2, this will allocate a new
209 * buffer of size `size` and copy the external data into it.
211 * Currently, this will never shrink a buffer, only expand it.
213 * If the allocation fails, this will return an error and the buffer will be
214 * marked as invalid for future operations, invaliding the contents.
216 * @param buffer The buffer to be resized; may or may not be allocated yet
217 * @param target_size The desired available size
218 * @return 0 on success, -1 on allocation failure
220 GIT_EXTERN(int) git_buf_grow(git_buf
*buffer
, size_t target_size
);
223 * Set buffer to a copy of some raw data.
225 * @param buffer The buffer to set
226 * @param data The data to copy into the buffer
227 * @param datalen The length of the data to copy into the buffer
228 * @return 0 on success, -1 on allocation failure
230 GIT_EXTERN(int) git_buf_set(
231 git_buf
*buffer
, const void *data
, size_t datalen
);
234 * Check quickly if buffer looks like it contains binary data
236 * @param buf Buffer to check
237 * @return 1 if buffer looks like non-text data
239 GIT_EXTERN(int) git_buf_is_binary(const git_buf
*buf
);
242 * Check quickly if buffer contains a NUL byte
244 * @param buf Buffer to check
245 * @return 1 if buffer contains a NUL byte
247 GIT_EXTERN(int) git_buf_contains_nul(const git_buf
*buf
);
250 * Free the memory referred to by the git_buf. This is an alias of
251 * `git_buf_dispose` and is preserved for backward compatibility.
253 * This function is deprecated, but there is no plan to remove this
254 * function at this time.
256 * @deprecated Use git_buf_dispose
257 * @see git_buf_dispose
259 GIT_EXTERN(void) git_buf_free(git_buf
*buffer
);
263 /** @name Deprecated Commit Definitions
268 * Provide a commit signature during commit creation.
270 * Callers should instead define a `git_commit_create_cb` that
271 * generates a commit buffer using `git_commit_create_buffer`, sign
272 * that buffer and call `git_commit_create_with_signature`.
274 * @deprecated use a `git_commit_create_cb` instead
276 typedef int (*git_commit_signing_cb
)(
278 git_buf
*signature_field
,
279 const char *commit_content
,
284 /** @name Deprecated Config Functions and Constants
288 #define GIT_CVAR_FALSE GIT_CONFIGMAP_FALSE
289 #define GIT_CVAR_TRUE GIT_CONFIGMAP_TRUE
290 #define GIT_CVAR_INT32 GIT_CONFIGMAP_INT32
291 #define GIT_CVAR_STRING GIT_CONFIGMAP_STRING
293 typedef git_configmap git_cvar_map
;
297 /** @name Deprecated Diff Functions and Constants
299 * These functions and enumeration values are retained for backward
300 * compatibility. The newer versions of these functions and values
301 * should be preferred in all new code.
303 * There is no plan to remove these backward compatibility values at
309 * Formatting options for diff e-mail generation
312 /** Normal patch, the default */
313 GIT_DIFF_FORMAT_EMAIL_NONE
= 0,
315 /** Don't insert "[PATCH]" in the subject header*/
316 GIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER
= (1 << 0),
318 } git_diff_format_email_flags_t
;
321 * Options for controlling the formatting of the generated e-mail.
324 unsigned int version
;
326 /** see `git_diff_format_email_flags_t` above */
329 /** This patch number */
332 /** Total number of patches in this series */
333 size_t total_patches
;
335 /** id to use for the commit */
338 /** Summary of the change */
341 /** Commit message's body */
344 /** Author of the change */
345 const git_signature
*author
;
346 } git_diff_format_email_options
;
348 #define GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION 1
349 #define GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT {GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION, 0, 1, 1, NULL, NULL, NULL, NULL}
352 * Create an e-mail ready patch from a diff.
354 * @deprecated git_email_create_from_diff
355 * @see git_email_create_from_diff
357 GIT_EXTERN(int) git_diff_format_email(
360 const git_diff_format_email_options
*opts
);
363 * Create an e-mail ready patch for a commit.
365 * @deprecated git_email_create_from_commit
366 * @see git_email_create_from_commit
368 GIT_EXTERN(int) git_diff_commit_as_email(
370 git_repository
*repo
,
373 size_t total_patches
,
375 const git_diff_options
*diff_opts
);
378 * Initialize git_diff_format_email_options structure
380 * Initializes a `git_diff_format_email_options` with default values. Equivalent
381 * to creating an instance with GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT.
383 * @param opts The `git_blame_options` struct to initialize.
384 * @param version The struct version; pass `GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION`.
385 * @return Zero on success; -1 on failure.
387 GIT_EXTERN(int) git_diff_format_email_options_init(
388 git_diff_format_email_options
*opts
,
389 unsigned int version
);
393 /** @name Deprecated Error Functions and Constants
395 * These functions and enumeration values are retained for backward
396 * compatibility. The newer versions of these functions and values
397 * should be preferred in all new code.
399 * There is no plan to remove these backward compatibility values at
404 #define GITERR_NONE GIT_ERROR_NONE
405 #define GITERR_NOMEMORY GIT_ERROR_NOMEMORY
406 #define GITERR_OS GIT_ERROR_OS
407 #define GITERR_INVALID GIT_ERROR_INVALID
408 #define GITERR_REFERENCE GIT_ERROR_REFERENCE
409 #define GITERR_ZLIB GIT_ERROR_ZLIB
410 #define GITERR_REPOSITORY GIT_ERROR_REPOSITORY
411 #define GITERR_CONFIG GIT_ERROR_CONFIG
412 #define GITERR_REGEX GIT_ERROR_REGEX
413 #define GITERR_ODB GIT_ERROR_ODB
414 #define GITERR_INDEX GIT_ERROR_INDEX
415 #define GITERR_OBJECT GIT_ERROR_OBJECT
416 #define GITERR_NET GIT_ERROR_NET
417 #define GITERR_TAG GIT_ERROR_TAG
418 #define GITERR_TREE GIT_ERROR_TREE
419 #define GITERR_INDEXER GIT_ERROR_INDEXER
420 #define GITERR_SSL GIT_ERROR_SSL
421 #define GITERR_SUBMODULE GIT_ERROR_SUBMODULE
422 #define GITERR_THREAD GIT_ERROR_THREAD
423 #define GITERR_STASH GIT_ERROR_STASH
424 #define GITERR_CHECKOUT GIT_ERROR_CHECKOUT
425 #define GITERR_FETCHHEAD GIT_ERROR_FETCHHEAD
426 #define GITERR_MERGE GIT_ERROR_MERGE
427 #define GITERR_SSH GIT_ERROR_SSH
428 #define GITERR_FILTER GIT_ERROR_FILTER
429 #define GITERR_REVERT GIT_ERROR_REVERT
430 #define GITERR_CALLBACK GIT_ERROR_CALLBACK
431 #define GITERR_CHERRYPICK GIT_ERROR_CHERRYPICK
432 #define GITERR_DESCRIBE GIT_ERROR_DESCRIBE
433 #define GITERR_REBASE GIT_ERROR_REBASE
434 #define GITERR_FILESYSTEM GIT_ERROR_FILESYSTEM
435 #define GITERR_PATCH GIT_ERROR_PATCH
436 #define GITERR_WORKTREE GIT_ERROR_WORKTREE
437 #define GITERR_SHA1 GIT_ERROR_SHA1
440 * Return the last `git_error` object that was generated for the
441 * current thread. This is an alias of `git_error_last` and is
442 * preserved for backward compatibility.
444 * This function is deprecated, but there is no plan to remove this
445 * function at this time.
447 * @deprecated Use git_error_last
448 * @see git_error_last
450 GIT_EXTERN(const git_error
*) giterr_last(void);
453 * Clear the last error. This is an alias of `git_error_last` and is
454 * preserved for backward compatibility.
456 * This function is deprecated, but there is no plan to remove this
457 * function at this time.
459 * @deprecated Use git_error_clear
460 * @see git_error_clear
462 GIT_EXTERN(void) giterr_clear(void);
465 * Sets the error message to the given string. This is an alias of
466 * `git_error_set_str` and is preserved for backward compatibility.
468 * This function is deprecated, but there is no plan to remove this
469 * function at this time.
471 * @deprecated Use git_error_set_str
472 * @see git_error_set_str
474 GIT_EXTERN(void) giterr_set_str(int error_class
, const char *string
);
477 * Indicates that an out-of-memory situation occurred. This is an alias
478 * of `git_error_set_oom` and is preserved for backward compatibility.
480 * This function is deprecated, but there is no plan to remove this
481 * function at this time.
483 * @deprecated Use git_error_set_oom
484 * @see git_error_set_oom
486 GIT_EXTERN(void) giterr_set_oom(void);
490 /** @name Deprecated Index Functions and Constants
492 * These functions and enumeration values are retained for backward
493 * compatibility. The newer versions of these values should be
494 * preferred in all new code.
496 * There is no plan to remove these backward compatibility values at
501 #define GIT_IDXENTRY_NAMEMASK GIT_INDEX_ENTRY_NAMEMASK
502 #define GIT_IDXENTRY_STAGEMASK GIT_INDEX_ENTRY_STAGEMASK
503 #define GIT_IDXENTRY_STAGESHIFT GIT_INDEX_ENTRY_STAGESHIFT
505 /* The git_indxentry_flag_t enum */
506 #define GIT_IDXENTRY_EXTENDED GIT_INDEX_ENTRY_EXTENDED
507 #define GIT_IDXENTRY_VALID GIT_INDEX_ENTRY_VALID
509 #define GIT_IDXENTRY_STAGE(E) GIT_INDEX_ENTRY_STAGE(E)
510 #define GIT_IDXENTRY_STAGE_SET(E,S) GIT_INDEX_ENTRY_STAGE_SET(E,S)
512 /* The git_idxentry_extended_flag_t enum */
513 #define GIT_IDXENTRY_INTENT_TO_ADD GIT_INDEX_ENTRY_INTENT_TO_ADD
514 #define GIT_IDXENTRY_SKIP_WORKTREE GIT_INDEX_ENTRY_SKIP_WORKTREE
515 #define GIT_IDXENTRY_EXTENDED_FLAGS (GIT_INDEX_ENTRY_INTENT_TO_ADD | GIT_INDEX_ENTRY_SKIP_WORKTREE)
516 #define GIT_IDXENTRY_EXTENDED2 (1 << 15)
517 #define GIT_IDXENTRY_UPDATE (1 << 0)
518 #define GIT_IDXENTRY_REMOVE (1 << 1)
519 #define GIT_IDXENTRY_UPTODATE (1 << 2)
520 #define GIT_IDXENTRY_ADDED (1 << 3)
521 #define GIT_IDXENTRY_HASHED (1 << 4)
522 #define GIT_IDXENTRY_UNHASHED (1 << 5)
523 #define GIT_IDXENTRY_WT_REMOVE (1 << 6)
524 #define GIT_IDXENTRY_CONFLICTED (1 << 7)
525 #define GIT_IDXENTRY_UNPACKED (1 << 8)
526 #define GIT_IDXENTRY_NEW_SKIP_WORKTREE (1 << 9)
528 /* The git_index_capability_t enum */
529 #define GIT_INDEXCAP_IGNORE_CASE GIT_INDEX_CAPABILITY_IGNORE_CASE
530 #define GIT_INDEXCAP_NO_FILEMODE GIT_INDEX_CAPABILITY_NO_FILEMODE
531 #define GIT_INDEXCAP_NO_SYMLINKS GIT_INDEX_CAPABILITY_NO_SYMLINKS
532 #define GIT_INDEXCAP_FROM_OWNER GIT_INDEX_CAPABILITY_FROM_OWNER
534 GIT_EXTERN(int) git_index_add_frombuffer(
536 const git_index_entry
*entry
,
537 const void *buffer
, size_t len
);
541 /** @name Deprecated Object Constants
543 * These enumeration values are retained for backward compatibility. The
544 * newer versions of these values should be preferred in all new code.
546 * There is no plan to remove these backward compatibility values at
551 #define git_otype git_object_t
553 #define GIT_OBJ_ANY GIT_OBJECT_ANY
554 #define GIT_OBJ_BAD GIT_OBJECT_INVALID
555 #define GIT_OBJ__EXT1 0
556 #define GIT_OBJ_COMMIT GIT_OBJECT_COMMIT
557 #define GIT_OBJ_TREE GIT_OBJECT_TREE
558 #define GIT_OBJ_BLOB GIT_OBJECT_BLOB
559 #define GIT_OBJ_TAG GIT_OBJECT_TAG
560 #define GIT_OBJ__EXT2 5
561 #define GIT_OBJ_OFS_DELTA GIT_OBJECT_OFS_DELTA
562 #define GIT_OBJ_REF_DELTA GIT_OBJECT_REF_DELTA
565 * Get the size in bytes for the structure which
566 * acts as an in-memory representation of any given
569 * For all the core types, this would the equivalent
570 * of calling `sizeof(git_commit)` if the core types
571 * were not opaque on the external API.
573 * @param type object type to get its size
574 * @return size in bytes of the object
576 GIT_EXTERN(size_t) git_object__size(git_object_t type
);
580 /** @name Deprecated Remote Functions
582 * These functions are retained for backward compatibility. The newer
583 * versions of these functions should be preferred in all new code.
585 * There is no plan to remove these backward compatibility functions at
591 * Ensure the remote name is well-formed.
593 * @deprecated Use git_remote_name_is_valid
594 * @param remote_name name to be checked.
595 * @return 1 if the reference name is acceptable; 0 if it isn't
597 GIT_EXTERN(int) git_remote_is_valid_name(const char *remote_name
);
601 /** @name Deprecated Reference Functions and Constants
603 * These functions and enumeration values are retained for backward
604 * compatibility. The newer versions of these values should be
605 * preferred in all new code.
607 * There is no plan to remove these backward compatibility values at
612 /** Basic type of any Git reference. */
613 #define git_ref_t git_reference_t
614 #define git_reference_normalize_t git_reference_format_t
616 #define GIT_REF_INVALID GIT_REFERENCE_INVALID
617 #define GIT_REF_OID GIT_REFERENCE_DIRECT
618 #define GIT_REF_SYMBOLIC GIT_REFERENCE_SYMBOLIC
619 #define GIT_REF_LISTALL GIT_REFERENCE_ALL
621 #define GIT_REF_FORMAT_NORMAL GIT_REFERENCE_FORMAT_NORMAL
622 #define GIT_REF_FORMAT_ALLOW_ONELEVEL GIT_REFERENCE_FORMAT_ALLOW_ONELEVEL
623 #define GIT_REF_FORMAT_REFSPEC_PATTERN GIT_REFERENCE_FORMAT_REFSPEC_PATTERN
624 #define GIT_REF_FORMAT_REFSPEC_SHORTHAND GIT_REFERENCE_FORMAT_REFSPEC_SHORTHAND
627 * Ensure the reference name is well-formed.
629 * Valid reference names must follow one of two patterns:
631 * 1. Top-level names must contain only capital letters and underscores,
632 * and must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD").
633 * 2. Names prefixed with "refs/" can be almost anything. You must avoid
634 * the characters '~', '^', ':', '\\', '?', '[', and '*', and the
635 * sequences ".." and "@{" which have special meaning to revparse.
637 * @deprecated Use git_reference_name_is_valid
638 * @param refname name to be checked.
639 * @return 1 if the reference name is acceptable; 0 if it isn't
641 GIT_EXTERN(int) git_reference_is_valid_name(const char *refname
);
643 GIT_EXTERN(int) git_tag_create_frombuffer(
645 git_repository
*repo
,
651 /** @name Deprecated Revspec Constants
653 * These enumeration values are retained for backward compatibility.
654 * The newer versions of these values should be preferred in all new
657 * There is no plan to remove these backward compatibility values at
662 typedef git_revspec_t git_revparse_mode_t
;
664 #define GIT_REVPARSE_SINGLE GIT_REVSPEC_SINGLE
665 #define GIT_REVPARSE_RANGE GIT_REVSPEC_RANGE
666 #define GIT_REVPARSE_MERGE_BASE GIT_REVSPEC_MERGE_BASE
670 /** @name Deprecated Credential Types
672 * These types are retained for backward compatibility. The newer
673 * versions of these values should be preferred in all new code.
675 * There is no plan to remove these backward compatibility values at
680 typedef git_credential git_cred
;
681 typedef git_credential_userpass_plaintext git_cred_userpass_plaintext
;
682 typedef git_credential_username git_cred_username
;
683 typedef git_credential_default git_cred_default
;
684 typedef git_credential_ssh_key git_cred_ssh_key
;
685 typedef git_credential_ssh_interactive git_cred_ssh_interactive
;
686 typedef git_credential_ssh_custom git_cred_ssh_custom
;
688 typedef git_credential_acquire_cb git_cred_acquire_cb
;
689 typedef git_credential_sign_cb git_cred_sign_callback
;
690 typedef git_credential_sign_cb git_cred_sign_cb
;
691 typedef git_credential_ssh_interactive_cb git_cred_ssh_interactive_callback
;
692 typedef git_credential_ssh_interactive_cb git_cred_ssh_interactive_cb
;
694 #define git_credtype_t git_credential_t
696 #define GIT_CREDTYPE_USERPASS_PLAINTEXT GIT_CREDENTIAL_USERPASS_PLAINTEXT
697 #define GIT_CREDTYPE_SSH_KEY GIT_CREDENTIAL_SSH_KEY
698 #define GIT_CREDTYPE_SSH_CUSTOM GIT_CREDENTIAL_SSH_CUSTOM
699 #define GIT_CREDTYPE_DEFAULT GIT_CREDENTIAL_DEFAULT
700 #define GIT_CREDTYPE_SSH_INTERACTIVE GIT_CREDENTIAL_SSH_INTERACTIVE
701 #define GIT_CREDTYPE_USERNAME GIT_CREDENTIAL_USERNAME
702 #define GIT_CREDTYPE_SSH_MEMORY GIT_CREDENTIAL_SSH_MEMORY
704 GIT_EXTERN(void) git_cred_free(git_credential
*cred
);
705 GIT_EXTERN(int) git_cred_has_username(git_credential
*cred
);
706 GIT_EXTERN(const char *) git_cred_get_username(git_credential
*cred
);
707 GIT_EXTERN(int) git_cred_userpass_plaintext_new(
708 git_credential
**out
,
709 const char *username
,
710 const char *password
);
711 GIT_EXTERN(int) git_cred_default_new(git_credential
**out
);
712 GIT_EXTERN(int) git_cred_username_new(git_credential
**out
, const char *username
);
713 GIT_EXTERN(int) git_cred_ssh_key_new(
714 git_credential
**out
,
715 const char *username
,
716 const char *publickey
,
717 const char *privatekey
,
718 const char *passphrase
);
719 GIT_EXTERN(int) git_cred_ssh_key_memory_new(
720 git_credential
**out
,
721 const char *username
,
722 const char *publickey
,
723 const char *privatekey
,
724 const char *passphrase
);
725 GIT_EXTERN(int) git_cred_ssh_interactive_new(
726 git_credential
**out
,
727 const char *username
,
728 git_credential_ssh_interactive_cb prompt_callback
,
730 GIT_EXTERN(int) git_cred_ssh_key_from_agent(
731 git_credential
**out
,
732 const char *username
);
733 GIT_EXTERN(int) git_cred_ssh_custom_new(
734 git_credential
**out
,
735 const char *username
,
736 const char *publickey
,
737 size_t publickey_len
,
738 git_credential_sign_cb sign_callback
,
741 /* Deprecated Credential Helper Types */
743 typedef git_credential_userpass_payload git_cred_userpass_payload
;
745 GIT_EXTERN(int) git_cred_userpass(
746 git_credential
**out
,
748 const char *user_from_url
,
749 unsigned int allowed_types
,
754 /** @name Deprecated Trace Callback Types
756 * These types are retained for backward compatibility. The newer
757 * versions of these values should be preferred in all new code.
759 * There is no plan to remove these backward compatibility values at
764 typedef git_trace_cb git_trace_callback
;
768 /** @name Deprecated Object ID Types
770 * These types are retained for backward compatibility. The newer
771 * versions of these values should be preferred in all new code.
773 * There is no plan to remove these backward compatibility values at
778 GIT_EXTERN(int) git_oid_iszero(const git_oid
*id
);
782 /** @name Deprecated OID Array Functions
784 * These types are retained for backward compatibility. The newer
785 * versions of these values should be preferred in all new code.
787 * There is no plan to remove these backward compatibility values at
793 * Free the memory referred to by the git_oidarray. This is an alias of
794 * `git_oidarray_dispose` and is preserved for backward compatibility.
796 * This function is deprecated, but there is no plan to remove this
797 * function at this time.
799 * @deprecated Use git_oidarray_dispose
800 * @see git_oidarray_dispose
802 GIT_EXTERN(void) git_oidarray_free(git_oidarray
*array
);
806 /** @name Deprecated Transfer Progress Types
808 * These types are retained for backward compatibility. The newer
809 * versions of these values should be preferred in all new code.
811 * There is no plan to remove these backward compatibility values at
817 * This structure is used to provide callers information about the
818 * progress of indexing a packfile.
820 * This type is deprecated, but there is no plan to remove this
821 * type definition at this time.
823 typedef git_indexer_progress git_transfer_progress
;
826 * Type definition for progress callbacks during indexing.
828 * This type is deprecated, but there is no plan to remove this
829 * type definition at this time.
831 typedef git_indexer_progress_cb git_transfer_progress_cb
;
834 * Type definition for push transfer progress callbacks.
836 * This type is deprecated, but there is no plan to remove this
837 * type definition at this time.
839 typedef git_push_transfer_progress_cb git_push_transfer_progress
;
841 /** The type of a remote completion event */
842 #define git_remote_completion_type git_remote_completion_t
845 * Callback for listing the remote heads
847 typedef int GIT_CALLBACK(git_headlist_cb
)(git_remote_head
*rhead
, void *payload
);
851 /** @name Deprecated String Array Functions
853 * These types are retained for backward compatibility. The newer
854 * versions of these values should be preferred in all new code.
856 * There is no plan to remove these backward compatibility values at
862 * Copy a string array object from source to target.
864 * This function is deprecated, but there is no plan to remove this
865 * function at this time.
869 * @return 0 on success, < 0 on allocation failure
871 GIT_EXTERN(int) git_strarray_copy(git_strarray
*tgt
, const git_strarray
*src
);
874 * Free the memory referred to by the git_strarray. This is an alias of
875 * `git_strarray_dispose` and is preserved for backward compatibility.
877 * This function is deprecated, but there is no plan to remove this
878 * function at this time.
880 * @deprecated Use git_strarray_dispose
881 * @see git_strarray_dispose
883 GIT_EXTERN(void) git_strarray_free(git_strarray
*array
);
887 /** @name Deprecated Options Initialization Functions
889 * These functions are retained for backward compatibility. The newer
890 * versions of these functions should be preferred in all new code.
892 * There is no plan to remove these backward compatibility functions at
897 GIT_EXTERN(int) git_blame_init_options(git_blame_options
*opts
, unsigned int version
);
898 GIT_EXTERN(int) git_checkout_init_options(git_checkout_options
*opts
, unsigned int version
);
899 GIT_EXTERN(int) git_cherrypick_init_options(git_cherrypick_options
*opts
, unsigned int version
);
900 GIT_EXTERN(int) git_clone_init_options(git_clone_options
*opts
, unsigned int version
);
901 GIT_EXTERN(int) git_describe_init_options(git_describe_options
*opts
, unsigned int version
);
902 GIT_EXTERN(int) git_describe_init_format_options(git_describe_format_options
*opts
, unsigned int version
);
903 GIT_EXTERN(int) git_diff_init_options(git_diff_options
*opts
, unsigned int version
);
904 GIT_EXTERN(int) git_diff_find_init_options(git_diff_find_options
*opts
, unsigned int version
);
905 GIT_EXTERN(int) git_diff_format_email_init_options(git_diff_format_email_options
*opts
, unsigned int version
);
906 GIT_EXTERN(int) git_diff_patchid_init_options(git_diff_patchid_options
*opts
, unsigned int version
);
907 GIT_EXTERN(int) git_fetch_init_options(git_fetch_options
*opts
, unsigned int version
);
908 GIT_EXTERN(int) git_indexer_init_options(git_indexer_options
*opts
, unsigned int version
);
909 GIT_EXTERN(int) git_merge_init_options(git_merge_options
*opts
, unsigned int version
);
910 GIT_EXTERN(int) git_merge_file_init_input(git_merge_file_input
*input
, unsigned int version
);
911 GIT_EXTERN(int) git_merge_file_init_options(git_merge_file_options
*opts
, unsigned int version
);
912 GIT_EXTERN(int) git_proxy_init_options(git_proxy_options
*opts
, unsigned int version
);
913 GIT_EXTERN(int) git_push_init_options(git_push_options
*opts
, unsigned int version
);
914 GIT_EXTERN(int) git_rebase_init_options(git_rebase_options
*opts
, unsigned int version
);
915 GIT_EXTERN(int) git_remote_create_init_options(git_remote_create_options
*opts
, unsigned int version
);
916 GIT_EXTERN(int) git_repository_init_init_options(git_repository_init_options
*opts
, unsigned int version
);
917 GIT_EXTERN(int) git_revert_init_options(git_revert_options
*opts
, unsigned int version
);
918 GIT_EXTERN(int) git_stash_apply_init_options(git_stash_apply_options
*opts
, unsigned int version
);
919 GIT_EXTERN(int) git_status_init_options(git_status_options
*opts
, unsigned int version
);
920 GIT_EXTERN(int) git_submodule_update_init_options(git_submodule_update_options
*opts
, unsigned int version
);
921 GIT_EXTERN(int) git_worktree_add_init_options(git_worktree_add_options
*opts
, unsigned int version
);
922 GIT_EXTERN(int) git_worktree_prune_init_options(git_worktree_prune_options
*opts
, unsigned int version
);