summaryrefslogtreecommitdiff
path: root/examples/common.c
Commit message (Collapse)AuthorAgeFilesLines
* examples: use username provided via URLPatrick Steinhardt2019-04-161-8/+9
| | | | | | | | The credentials callback may be passed a username in case where the URL already includes the expected username. As we usually cannot use a different username in such context, we should use that one if provided and not ask the user for a diferent username.
* examples: implement SSH key credentialsPatrick Steinhardt2019-04-161-8/+8
| | | | | Implement SSH key credentials. This allows users to use the SSH transport with the lg2 example code.
* examples: implement SSH key credentialsPatrick Steinhardt2019-04-161-2/+18
| | | | | Implement SSH key credentials. This allows users to use the SSH transport with the lg2 example code.
* examples: support plain username credentialsPatrick Steinhardt2019-04-161-0/+5
| | | | | | | Implement plain username credential types. These type of credentials might be asked for e.g. as some kind of pre-authentication step, before the actual credentials are passed.
* examples: honor allowed credential types when prompting userPatrick Steinhardt2019-04-161-16/+20
| | | | | | | | | | | | | Credential callback are being passed a bitset that indicates which credential types are allowed in the current context. In our examples code, we completely ignore that field and always return username/password credentials, which doesn't necessarily make sense e.g. when only SSH keys are allowed. Refactor the code and only return username/password credentials in the case where `USERPASS_PLAINTEXT` credentials are allowed. Otherwise, return a positive error code to indicate that no credentials could be acquired.
* examples: merge common network codePatrick Steinhardt2019-02-151-0/+76
| | | | | | | | | | | | Right now, we have two sets of "common" code, one containing general common code and one containing network common code. As we intend to get rid of the network subdirectory and instead merge all examples into a single standalone executable, this distinction doesn't make a lot of sense now. Furthermore, the common network code is not that big. Let's get rid of the common network code by merging it into the general common code.
* errors: remove giterr usage in examplesEdward Thomson2019-01-221-1/+1
|
* object_type: convert final internal users to new namesethomson/git_objEdward Thomson2019-01-171-1/+1
| | | | | Update some missed types that were continuing to use the old `GIT_OBJ` names.
* examples: add a helper for boolean-style optionsEtienne Samson2018-07-071-0/+19
|
* examples: make the refish resolution work with short OIDsEtienne Samson2018-07-071-3/+4
|
* examples: move refish resolution function in commonEtienne Samson2018-07-071-0/+24
|
* examples: Move xrealloc to common example codeEtienne Samson2018-01-251-0/+10
|
* examples: diff: parse correct types for line-diffoptsPatrick Steinhardt2016-10-101-0/+19
|
* describe: add exampleLinquize2014-10-121-0/+27
|
* - BUGFIX #2133 (@fourplusone) in smart_protocol.cMiha2014-02-251-1/+1
| | | | | | - added MSVC cmake definitions to disable warnings - general.c is rewritten so it is ansi-c compatible and compiles ok on microsoft windows - some MSVC reported warning fixes
* Replace copyright topmatter in example filesBen Straub2013-11-021-3/+10
|
* Extract common example helpers and reorg examplesRussell Belfer2013-10-291-0/+184
This reorganizes a few of the examples so that the main function comes first with the argument parsing extracted into a helper that can come at the end of the file (so the example focuses more on the use of libgit2 instead of command line support). This also creates a shared examples/common.[ch] so that useful helper funcs can be shared across examples instead of repeated.