summaryrefslogtreecommitdiff
path: root/examples/network
Commit message (Collapse)AuthorAgeFilesLines
* errors: remove giterr usage in examplesEdward Thomson2019-01-222-3/+3
|
* Merge pull request #4374 from pks-t/pks/pack-file-verifyEdward Thomson2018-08-261-1/+1
|\ | | | | Pack file verification
| * indexer: introduce options struct to `git_indexer_new`Patrick Steinhardt2018-06-221-1/+1
| | | | | | | | | | | | | | | | | | | | We strive to keep an options structure to many functions to be able to extend options in the future without breaking the API. `git_indexer_new` doesn't have one right now, but we want to be able to add an option for enabling strict packfile verification. Add a new `git_indexer_options` structure and adjust callers to use that.
* | treewide: remove use of C++ style commentsPatrick Steinhardt2018-07-133-8/+10
|/ | | | | | | | | C++ style comment ("//") are not specified by the ISO C90 standard and thus do not conform to it. While libgit2 aims to conform to C90, we did not enforce it until now, which is why quite a lot of these non-conforming comments have snuck into our codebase. Do a tree-wide conversion of all C++ style comments to the supported C style comments to allow us enforcing strict C90 compliance in a later commit.
* examples: Dead code & warningsEtienne Samson2018-01-251-7/+0
|
* examples: Switch to the nifty argv helpers from commonEtienne Samson2018-01-251-18/+35
|
* examples: network: fix Win32 linking errors due to getlinePatrick Steinhardt2017-11-061-2/+39
| | | | | | | | | | | | The getline(3) function call is not part of ISO C and, most importantly, it is not implemented on Microsoft Windows platforms. As our networking example code makes use of getline, this breaks builds on MSVC and MinGW. As this code wasn't built prior to the previous commit, this was never noticed. Fix the error by instead implementing a `readline` function, which simply reads the password from stdin until it reads a newline character.
* examples: network: refactor credentials callbackPatrick Steinhardt2017-05-151-5/+19
| | | | | | | | The credentials callback reads the username and password via scanf into fixed-length arrays. While these are simply examples and as such not as interesting, the unchecked return value of scanf causes GCC to emit warnings. So while we're busy to shut up GCC, we also fix the possible overflow of scanf by using getline instead.
* fix examples/network/clone.c: heap-buffer-overflowForce.Charlie-I2017-01-091-1/+1
| | | Format of a length of string to the correct format is:%.*s
* examples: fix warnings in network/fetch.cPatrick Steinhardt2016-10-101-7/+7
|
* proxy: ask the user for credentials if necessaryCarlos Martín Nieto2016-04-191-1/+1
|
* fix returnEun2015-10-071-0/+1
|
* Update another call to git_remote_connectMatt Burke2015-09-081-1/+1
|
* Merge pull request #3306 from libgit2/cmn/fetch-ex-fetchCarlos Martín Nieto2015-07-131-74/+27
|\ | | | | examples: modernise the fetch example
| * examples: modernise the fetch examplecmn/fetch-ex-fetchCarlos Martín Nieto2015-07-121-74/+27
| | | | | | | | | | Under normal conditions, git_remote_fetch() should be the only function used to perform a fetch. Don't let the example lead people astray.
* | Fix #3094 - improve use of portable size_t/ssize_t format specifiers.Matthew Plough2015-07-121-2/+2
|/ | | | The header src/cc-compat.h defines portable format specifiers PRIuZ, PRIdZ, and PRIxZ. The original report highlighted the need to use these specifiers in examples/network/fetch.c. For this commit, I checked all C source and header files not in deps/ and transitioned to the appropriate format specifier where appropriate.
* examples: clean up some warningsEdward Thomson2015-06-291-0/+2
|
* remote: remove fetch parameter from create_anonymousCarlos Martín Nieto2015-05-282-2/+2
| | | | | | An anonymous remote is not configured and cannot therefore have configured refspecs. Remove the parameter which adds this from the constructor.
* examples: show the sideband progress on cloneCarlos Martín Nieto2015-05-131-0/+8
| | | | | This lets us see what the server (or libgit2 locally) is doing, rather than having to stare at a non-moving screen.
* examples: adjust to the new remote APICarlos Martín Nieto2015-05-133-13/+13
|
* Restructured to be nicer exampleTomas Paladin Volf2015-05-021-9/+14
| | | | | Code restructured to better represent best practice when using libgit2.
* Added call to git_libgit2_shutdown()Tomas Paladin Volf2015-04-301-2/+4
| | | Added forgotten call to git_libgit2_shutdown() to the /examples/network/git2.c.
* Remove the signature from ref-modifying functionsCarlos Martín Nieto2015-03-031-1/+1
| | | | | | | | | | The signature for the reflog is not something which changes dynamically. Almost all uses will be NULL, since we want for the repository's default identity to be used, making it noise. In order to allow for changing the identity, we instead provide git_repository_set_ident() and git_repository_ident() which allow a user to override the choice of signature.
* example: drop `SAFE_CREATE` from clone exampleEdward Thomson2015-02-271-1/+1
|
* clone example: don't divide by zeroEdward Thomson2015-01-101-3/+9
| | | | | Local transports don't have data about the size, avoid dividing by zero in the callback.
* Rename git_threads_ to git_libgit2_Carlos Martín Nieto2014-11-081-1/+1
| | | | | | This describes their purpose better, as we now initialize ssl and some other global stuff in there. Calling the init function is not something which has been optional for a while now.
* remote: rename _load() to _lookup()cmn/remote-lookupCarlos Martín Nieto2014-11-082-2/+2
| | | | This brings it in line with the rest of the lookup functions.
* remote: allow overriding the refspecs for download and fetchCarlos Martín Nieto2014-09-301-1/+1
| | | | | | | With opportunistic ref updates, git has introduced the concept of having base refspecs *and* refspecs that are active for a particular fetch. Let's start by letting the user override the refspecs for download.
* Fix typoLinquize2014-09-161-1/+1
|
* Don't redefine the same callback types, their signatures may changeJacques Germishuys2014-04-211-1/+1
|
* remote: rename inmemory to anonymous and swap url and fetch orderCarlos Martín Nieto2014-04-012-2/+2
| | | | | | | | | | The order in this function is the opposite to what create_with_fetchspec() has, so change this one, as url-then-refspec is what git does. As we need to break compilation and the swap doesn't do that, let's take this opportunity to rename in-memory remotes to anonymous as that's really what sets them apart.
* git_checkout_opts -> git_checkout_optionsBen Straub2014-03-061-1/+1
|
* - 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
* Fix a few references to changed function signaturesBen Straub2014-02-051-1/+1
|
* Merge pull request #1956 from libgit2/cmn/fetch-default-headVicent Martí2013-11-111-12/+14
|\ | | | | Remote revamp (director's cut)
| * remote: make _ls return the list directlyCarlos Martín Nieto2013-11-111-12/+14
| | | | | | | | | | | | | | | | | | | | | | The callback-based method of listing remote references dates back to the beginning of the network code's lifetime, when we didn't know any better. We need to keep the list around for update_tips() after disconnect() so let's make use of this to simply give the user a pointer to the array so they can write straightforward code instead of having to go through a callback.
* | update example to new packfile creation signatureEdward Thomson2013-11-071-1/+1
| |
* | Fix warningsBen Straub2013-11-041-2/+2
|/
* Merge pull request #1916 from libgit2/simplify-examplesVicent Martí2013-11-012-3/+17
|\ | | | | Fix examples to make the important stuff more obvious
| * Fix typosBen Straub2013-11-011-2/+2
| |
| * A few formatting changes for roccoCarlos Martín Nieto2013-11-012-3/+17
| | | | | | | | | | I'm not too happy about manually inserting < and > but those get output as html tags otherwise.
* | indexer: remove the stream infixCarlos Martín Nieto2013-10-301-6/+6
|/ | | | | | | | | | | It was there to keep it apart from the one which read in from a file on disk. This other indexer does not exist anymore, so there is no need for anything other than git_indexer to refer to it. While here, rename _add() function to _append() and _finalize() to _commit(). The former change is cosmetic, while the latter avoids talking about "finalizing", which OO languages use to mean something completely different.
* Merge pull request #1891 from libgit2/cmn/fix-thin-packsVicent Martí2013-10-283-4/+20
|\ | | | | Add support for thin packs
| * indexer: include the delta statsCarlos Martín Nieto2013-10-232-2/+13
| | | | | | | | | | | | | | | | | | | | The user is unable to derive the number of deltas in the pack, as that would require them to capture the stats exactly in the moment between download and final processing, which is abstracted away in the fetch. Capture these numbers for the user and expose them in the progress struct. The clone and fetch examples now also present this information to the user.
| * examples: show used local objects in fetchCarlos Martín Nieto2013-10-231-1/+6
| | | | | | | | | | Show how many local objects were used to fix the thin pack in our fetch example.
| * indexer: fix thin packsCarlos Martín Nieto2013-10-041-1/+1
| | | | | | | | | | | | When given an ODB from which to read objects, the indexer will attempt to inject the missing bases at the end of the pack and update the header and trailer to reflect the new contents.
* | clone: put the callbacks struct directly in the clone optionsCarlos Martín Nieto2013-10-021-5/+3
| | | | | | | | There's no need for this to be a pointer to somewhere else.
* | remote: move the credentials callback to the structCarlos Martín Nieto2013-10-023-3/+5
| | | | | | | | | | Move this one as well, letting us have a single way of setting the callbacks for the remote, and removing fields from the clone options.
* | remote: put the _download() callback with the othersCarlos Martín Nieto2013-10-022-3/+5
|/ | | | | | The text progress and update_tips callbacks are already part of the struct, which was meant to unify the callback setup, but the download one was left out.
* Adding credentials callback to ls-remote and fetch too.Krzysztof Adamski2013-09-016-33/+45
|