summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* | | refs: Cleanup reference renamingVicent Marti2011-07-063-36/+33
| | | | | | | | | | | | | | | | | | | | | `git_futils_rmdir_r`: rename, clean up. `git_reference_rename`: cleanup. Do not use 3x4096 buffers on the stack or things will get ugly very fast. We can reuse the same buffer.
* | | Remove duplicated recursive directory removal related codenulltoken2011-07-062-8/+10
| | |
* | | Fix windows specific issuesnulltoken2011-07-062-1/+3
| | | | | | | | | | | | | | | - msvc compilation warnings - not released file handle that prevents file removal
* | | reference_rename: git compliant reference renamingschu2011-07-062-91/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far libgit2 didn't handle the following scenarios: * Rename of reference m -> m/m * Rename of reference n/n -> n Fixed. Since we don't write reflogs, we have to delete any old reflog for the renamed reference. Otherwise git.git will possibly fail when it finds invalid logs. Reported-by: nulltoken <emeric.fermas@gmail.com> Signed-off-by: schu <schu-github@schulog.org>
* | | fileops: add git_futils_rmdir_recurs()schu2011-07-062-0/+28
| | | | | | | | | | | | | | | | | | | | | git_futils_rmdir_recurs() shall remove the given directory and all subdirectories. This happens only if the directories are empty. Signed-off-by: schu <schu-github@schulog.org>
* | | fileops: add convenience function is_dot_or_dotdot()schu2011-07-062-7/+10
| |/ |/| | | | | Signed-off-by: schu <schu-github@schulog.org>
* | fnmatch: Fix compilation under WindowsVicent Marti2011-07-061-2/+2
| |
* | fnmatch: Use native on Unix, emulate on Win32Vicent Marti2011-07-067-577/+258
| |
* | Also update local_connect's unused var name for MSVCCarlos Martín Nieto2011-07-051-1/+1
| | | | | | | | Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* | repository: fix typo'ed assertnulltoken2011-07-051-1/+1
|/
* repository: Fix unused parameter in Unix systemsVicent Marti2011-07-051-2/+2
|
* Merge pull request #302 from carlosmn/developmentVicent Martí2011-07-051-1/+6
|\ | | | | Small fixes in pack_window_open
| * Small fixes in pack_window_openCarlos Martín Nieto2011-07-051-1/+6
| | | | | | | | | | | | | | Check if the window structure has actually been allocated before trying to access it, and don't leak said structure if the map fails. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* | Merge pull request #297 from nulltoken/patch-5Vicent Martí2011-07-051-3/+3
|\ \ | |/ |/| Fix MSVC compilation issue
| * Fix MSVC compilation issuenulltoken2011-07-051-3/+3
| |
* | Include common.h in hashtable.hCarlos Martín Nieto2011-07-051-0/+1
| | | | | | | | | | | | | | Without this, hashtable.h doesn't know what uint32_t is and the compiler thinks that it's a function type. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* | Merge pull request #300 from carlosmn/gsoc2011/masterVicent Martí2011-07-0515-0/+2060
|\ \ | |/ |/| A bit of networking
| * Slim down git_transportCarlos Martín Nieto2011-06-275-17/+10
| | | | | | | | | | | | | | | | Remove the unused repo and private pointers and make the direction a flag, as it can only have two states. Change the connect signature to use an int instead of git_net_direction and remove that enum. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
| * Initialize memory in git transportCarlos Martín Nieto2011-06-271-0/+3
| | | | | | | | | | | | At the same time, do mark the transport as connected. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
| * Add git_remote_connect and git_remote_lsCarlos Martín Nieto2011-06-272-0/+36
| | | | | | | | | | | | | | These allow you to implement git-ls-remote when given a reference name and a repository. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
| * Use gitno_buffer in the git transportCarlos Martín Nieto2011-06-274-32/+24
| | | | | | | | | | | | This allows us to leave out the buffer handling logic. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
| * Add gitno_buffer as a recv wrapperCarlos Martín Nieto2011-06-272-0/+59
| | | | | | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
| * Remove the repo param from git_transport_newCarlos Martín Nieto2011-06-261-3/+1
| | | | | | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
| * Move transports to an inheritance modelCarlos Martín Nieto2011-06-264-78/+73
| | | | | | | | | | | | | | | | | | Rather than an 'private' pointer, make the private structures inherit from the generic git_transport struct. This way, we only have to worry about one memory allocation instead of two. The structures are so simple that this may even make the code use less memory overall. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
| * local transport: keep better track of memoryCarlos Martín Nieto2011-06-261-12/+46
| | | | | | | | | | | | | | Store the ref information in a private struct so we can free it together with the rest. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
| * local transport: sort the refs before resolving themCarlos Martín Nieto2011-06-261-20/+30
| | | | | | | | | | | | | | | | | | By pre-sorting the references, they are already in the right order if we want to peel them. With this, we get output-parity with git.git's ls-remote. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
| * Move git_pkt_{gen_proto,send_request} to transport_git.cCarlos Martín Nieto2011-06-262-59/+56
| | | | | | | | | | | | | | This is where they really belong. Remvoe the prefix and make them static. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
| * Use (s)size_tCarlos Martín Nieto2011-06-261-3/+3
| | | | | | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
| * Implement and use git_pkt_send_requestCarlos Martín Nieto2011-06-262-17/+34
| | | | | | | | | | | | | | | | | | | | This makes it easier to send a requqest for an URL. It assumes there is a socket where the string should go out to. Make git_pkt_gen_proto accept a command parameter, which defaults to git-upload-pack Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
| * Implement and use gitno_sendCarlos Martín Nieto2011-06-263-9/+28
| |
| * Create netops and start moving git:// to itCarlos Martín Nieto2011-06-263-34/+96
| | | | | | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
| * Correctly handle network inputCarlos Martín Nieto2011-06-262-55/+85
| | | | | | | | | | | | | | | | | | Add a parameter to git_pkt_parse_line to tell it how much data you have in your buffer. If the buffer is too short, it returns an error saying so. Adapt the git transport to use this and fix the offset calculation. Add the GIT_ESHORTBUFFER error code.
| * Implement and use git_pkt_freeCarlos Martín Nieto2011-06-262-6/+12
| | | | | | | | | | | | | | A git_pkt object can be one of several structs. Add this function for convenience and clarity. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
| * Implement the git TCP transport up to ls-remoteCarlos Martín Nieto2011-06-263-1/+314
| | | | | | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
| * Add function to generate a requestCarlos Martín Nieto2011-06-261-0/+39
| | | | | | | | | | | | Add git_pkt_gen_proto to crete a request from an url. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
| * pkt-line: read capabilitiesCarlos Martín Nieto2011-06-262-1/+23
| | | | | | | | | | | | | | Try to read the server capabilities and add them to the git_pkt_ref struct. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
| * pkt-line: parse other-ref linesCarlos Martín Nieto2011-06-261-4/+57
| | | | | | | | | | | | Add support for parsing other-ref lines. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
| * pkt: make sure we really only read the lengthCarlos Martín Nieto2011-06-261-3/+16
| | | | | | | | | | | | | | | | A pkt-line's length are described in its first four bytes in ASCII hex. Copy this substring to another string before feeding it to git__strtol32. Otherwise, it will read the whole hash. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
| * Move flush-pkt creation into its own functionCarlos Martín Nieto2011-06-261-10/+19
| | | | | | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
| * Lay the foundations for pkt-line parsingCarlos Martín Nieto2011-06-261-0/+80
| | | | | | | | | | | | | | | | This are the types I intend to use for pkt-line parsing and (later) creation. git_pkt serves as a base pointer type and once you know what type it is you can use the real one (command, tip list, etc.) Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
| * Implement ls-remote on local driveCarlos Martín Nieto2011-06-263-2/+168
| | | | | | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
| * Lay down the fundations for the network codeCarlos Martín Nieto2011-06-263-0/+197
| | | | | | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
| * Add git_refspec_transformCarlos Martín Nieto2011-06-261-0/+36
| | | | | | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
| * Add git.git's fnmatch, which is really GNU's and the git__fnmatch wrapperCarlos Martín Nieto2011-06-265-0/+603
| | | | | | | | | | | | | | | | | | | | | | | | | | If the strings match, git__fnmatch returns GIT_SUCCESS and GIT_ENOMATCH on failure to match. MSVC fixes: Added a test for _MSC_VER and (in that case) defined HAVE_STRING_H to 1 so it doesn't try to include <strings.h> which doesn't exist in the MSVC world. Moved the function declarations to use the modern inline ones so MSVC doesn't have a fit. Added casts everywhere so MSVC doesn't crap its pants. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
| * Abstract the refspec query and parseCarlos Martín Nieto2011-06-261-11/+9
| | | | | | | | | | | | | | | | | | | | Move them to their own functions to avoid duplication and to make it easier to ignore missing configuration. Not finding 'fetch' is considered fatal, though this might not be correct behaviour (push-only remotes?) Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
| * Add a remotes APICarlos Martín Nieto2011-06-264-0/+280
| | | | | | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* | Correctly detect truncated input in header parsingCarlos Martín Nieto2011-07-051-5/+3
| | | | | | | | | | | | | | | | | | | | | | If the section header is the last line in the file, parse_section_header would incorrectly decide that the input had been truncated. Fix this by checking whether the actual input line is correctly formatted. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* | git_config_add_file should rethrowCarlos Martín Nieto2011-07-051-1/+1
| | | | | | | | | | | | Otherwise, the information about why there was an error gets lost. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* | Add git_config_del to delete a variableCarlos Martín Nieto2011-07-052-7/+19
| | | | | | | | Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* | signature: Fix warningsVicent Marti2011-07-051-7/+4
| | | | | | | | | | | | Add extra braces to avoid ambiguous if-else. Also, free() doesn't need a check.