summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | Add git_clone and git_clone_bare.Ben Straub2012-06-211-0/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far they only create a repo, setup the "origin" remote, and fetch. The API probably needs work as well; there's no way to get progress information at this point. Also uncovered a shortcoming; git_remote_download doesn't fetch over local transport.
* | | | Fix compilation warningnulltoken2012-08-151-1/+1
| | | |
* | | | Merge pull request #873 from carlosmn/tree-walkCarlos Martín Nieto2012-08-141-4/+7
|\ \ \ \ | | | | | | | | | | git_tree_walk callback return value semantic does not match documentation
| * | | | tree: allow the user to skip an entry or cancel the walkCarlos Martín Nieto2012-08-131-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Returning a negative cancels the walk, and returning a positive one causes us to skip an entry, which was previously done by a negative value. This allows us to stay consistent with the rest of the functions that take a callback and keeps the skipping functionality.
| * | | | tree: bring back the documented behaviour for a walkCarlos Martín Nieto2012-08-131-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | However, there should be a way to cancel the walk and another to skip the entry.
* | | | | Merge pull request #875 from arrbee/fix-message-prettify-length-checkRussell Belfer2012-08-141-10/+14
|\ \ \ \ \ | | | | | | | | | | | | Fix message prettify length check
| * | | | | Make git_message_prettify return bytes writtenRussell Belfer2012-08-141-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you want to be absolutely safe with git_message_prettify, you can now pass a NULL pointer for the buffer and get back the number of bytes that would be copied into the buffer. This means that an error is a non-negative return code and a success will be greater than zero from this function.
| * | | | | Check prettify message output buffer after cleanupRussell Belfer2012-08-121-4/+6
| |/ / / / | | | | | | | | | | | | | | | This makes the message prettify buffer length check accurate.
* | | | | Clean up codeRussell Belfer2012-08-121-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Okay, this is probably cleaner and it is also less net change from the original version
* | | | | Fix config parser boundary logicRussell Belfer2012-08-121-4/+3
|/ / / / | | | | | | | | | | | | | | | | | | | | The config file parser was not working right if there was no whitespace between the value name and the equals sign. This fixes that.
* | | | sha1: add missing header guardsMichael Schubert2012-08-111-0/+5
| | | |
* | | | oid: Explicitly include `oid.h` for the inlined CMPVicent Marti2012-08-098-0/+8
| | | |
* | | | trim whitespace when parsing loose refsRussell Belfer2012-08-091-36/+13
| | | |
* | | | Fix iterator check and return valueRussell Belfer2012-08-061-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a little cleanup necessary from PR #843. Since the new callbacks return `GIT_EUSER` we have to be a little careful about return values when they are used internally to the library. Also, callbacks should be checked for non-zero return values, not just less than zero.
* | | | remotes: Proper return for `git_remote_ls`Vicent Marti2012-08-061-4/+2
| | | |
* | | | Merge remote-tracking branch 'arrbee/tree-walk-fixes' into developmentVicent Marti2012-08-0612-109/+170
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/notes.c src/transports/git.c src/transports/http.c src/transports/local.c tests-clar/odb/foreach.c
| * | | | Add new iteration behavior to git_tree_walkRussell Belfer2012-08-031-4/+6
| | | | | | | | | | | | | | | | | | | | Missed this one, ironically enough.
| * | | | Update iterators for consistency across libraryRussell Belfer2012-08-0314-112/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This updates all the `foreach()` type functions across the library that take callbacks from the user to have a consistent behavior. The rules are: * A callback terminates the loop by returning any non-zero value * Once the callback returns non-zero, it will not be called again (i.e. the loop stops all iteration regardless of state) * If the callback returns non-zero, the parent fn returns GIT_EUSER * Although the parent returns GIT_EUSER, no error will be set in the library and `giterr_last()` will return NULL if called. This commit makes those changes across the library and adds tests for most of the iteration APIs to make sure that they follow the above rules.
| * | | | Fix git_tree_walk to return user errorRussell Belfer2012-07-261-8/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes sure that an error code returned by the callback function of `git_tree_walk` will stop the iteration and get propagated back to the caller verbatim. Also, this adds a minor helper function `git_tree_entry_byoid` that searches a `git_tree` for an entry with the given OID. This isn't a fast function, but it's easier than writing the loop yourself as an external user of the library.
* | | | | remote: add missing include git2/remote.hMichael Schubert2012-08-043-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Otherwise we get an incomplete type error, since git_remote_callbacks isn't declared yet.
* | | | | filebuf: Check the return value for `close`Vicent Marti2012-08-031-2/+7
| | | | |
* | | | | win32: set errno to ENOENT or ENOTDIR when appropriate in do_lstatCarlos Martín Nieto2012-08-021-0/+7
| | | | |
* | | | | Merge remote-tracking branch 'nulltoken/topic/amd64-compat' into developmentVicent Marti2012-08-0223-70/+76
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/netops.c src/netops.h src/oid.c
| * | | | | portability: Improve x86/amd64 compatibilitynulltoken2012-07-2423-67/+68
| | | | | |
* | | | | | Merge pull request #850 from libgit2/attr-exportVicent Martí2012-08-013-8/+27
|\ \ \ \ \ \ | | | | | | | | | | | | | | attr: Do not export variables externally
| * | | | | | attr: Do not export variables externallyattr-exportVicent Marti2012-08-023-8/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #824 Exporting variables in a dynamic library is a PITA. Let's keep these values internally and wrap them through a helper method. This doesn't break the external API. @arrbee, aren't you glad I turned the `GIT_ATTR_` macros into function macros? :sparkles:
* | | | | | | repository: IndentationVicent Marti2012-08-021-29/+28
| | | | | | |
* | | | | | | Merge pull request #848 from carlosmn/pending-messageVicent Martí2012-08-011-0/+56
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | repository: add a getter and remove function for git's prepared message
| * | | | | | repository: add a getter and remove function for git's prepared messageCarlos Martín Nieto2012-08-011-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'git revert/cherry-pick/merge -n' commands leave .git/MERGE_MSG behind so that git-commit can find it. As we don't yet support these operations, users who are shelling out to let git perform these operations haven't had a convenient way to get this message. These functions allow the user to retrieve the message and remove it when she's created the commit.
* | | | | | | Add function to query for compile time settings.Sascha Cunz2012-08-011-0/+12
|/ / / / / /
* | | | | | Merge pull request #826 from carlosmn/config-find-errorVicent Martí2012-07-311-0/+4
|\ \ \ \ \ \ | | | | | | | | | | | | | | git_config_find_* does not set a git error
| * | | | | | config: set the error code if we can't find the global/system configCarlos Martín Nieto2012-07-231-0/+4
| | | | | | |
* | | | | | | Merge pull request #833 from carlosmn/odb-oneVicent Martí2012-07-312-0/+48
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | odb: allow creating an ODB backend from a packfile index
| * | | | | | | repo: add git_repository_wrap_odb() to wrap an ODBCarlos Martín Nieto2012-07-211-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Primarily useful when used together with git_odb_backend_one_pack().
| * | | | | | | odb: allow creating an ODB backend from a packfile indexCarlos Martín Nieto2012-07-211-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git_odb_backend_one_packfile() allows us to create an ODB backend out of an .idx file.
* | | | | | | | transport: rename encrypt to use_sslCarlos Martín Nieto2012-07-303-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SSL isn't the only way that a transport can be encrypted. The new name will make it easier to merge the SSH support.
* | | | | | | | fetch: remove timeout codeCarlos Martín Nieto2012-07-301-13/+0
| | | | | | | |
* | | | | | | | ssl: use the callback instead of ifs to determine how to get dataCarlos Martín Nieto2012-07-301-40/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using the callbacks makes it clearer and reduces the amount of #ifdefs and ifs and we need in the code.
* | | | | | | | transport: store the refs in a common areaCarlos Martín Nieto2012-07-308-297/+184
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instad of each transport having its own function and logic to get to its refs, store them directly in transport. Leverage the new gitno_buffer to make the parsing and storing of the refs use common code and get rid of the git_protocol struct.
* | | | | | | | remote: use the same code to control git and httpCarlos Martín Nieto2012-07-3010-317/+193
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us to add capabilitites to both at the same time, keeps them in sync and removes a lot of code. gitno_buffer now uses a callback to fill its buffer, allowing us to use the same interface for git and http (which uses callbacks).
* | | | | | | | network: implement multi_ack for the git transportCarlos Martín Nieto2012-07-304-26/+85
| | | | | | | |
* | | | | | | | remote: start moving the protocol to a common areaCarlos Martín Nieto2012-07-306-167/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the transition, http is going to keep its own logic until the git/common code catches up with the implied multi_ack that http has. This also has the side-effect of making the code cleaner and more correct regardingt he protocol.
* | | | | | | | git_oid_cmp: inline memcmp by hand to optimizeMichael Schubert2012-07-292-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git.git uses an inlined hashcmp function instead of memcmp, since it performes much better when comparing hashes (most hashes compared diverge within the first byte). Measurements and rationale for the curious reader: http://thread.gmane.org/gmane.comp.version-control.git/172286
* | | | | | | | Fix -Wuninitialized warningMichael Schubert2012-07-281-1/+1
| |_|_|_|_|_|/ |/| | | | | |
* | | | | | | Merge pull request #834 from carlosmn/network-callbacksVicent Martí2012-07-272-3/+11
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Add a struct for network callbacks
| * | | | | | | Add a struct for network callbacksCarlos Martín Nieto2012-07-212-3/+11
| | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | Currently only update_tips is used, but it prepares the way for progress output during download.
* | | | | | | branch: Add `repository` argument to `create`Vicent Marti2012-07-272-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Yes, we can get the repository from the owner of the object, but having it marked explicitly makes the API more consistent.
* | | | | | | Merge remote-tracking branch 'nulltoken/topic/branch-rework' into developmentVicent Marti2012-07-274-110/+107
|\ \ \ \ \ \ \
| * | | | | | | branch: enforce git_branch_delete() parameter checkingnulltoken2012-07-241-0/+1
| | | | | | | |
| * | | | | | | refs: drop git_reference_remote_tracking_from_branch()nulltoken2012-07-241-74/+0
| | | | | | | |