|
a68cf94b
|
2011-04-19T16:40:52
|
|
Fix const char ** warning
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
a99264bf
|
2011-04-19T16:34:22
|
|
config: allow uppercase number suffixes
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
52ca4f8a
|
2011-04-11T17:51:05
|
|
Use internal strtol
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
631752aa
|
2011-04-11T17:49:47
|
|
Fix number suffix detection
Allow a number not to have a suffix. This broke when adding the
suffixes.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
55c197cd
|
2011-04-11T17:41:21
|
|
Merge upstream/development
|
|
a6359408
|
2011-04-10T12:23:55
|
|
Use Z_BEST_SPEED for filebuf deflating
This is what Git uses by default for all deflating.
|
|
53b7560b
|
2011-04-09T16:16:09
|
|
Fix `time_t` conversion on Win32
|
|
14eb94ee
|
2011-04-09T16:06:17
|
|
Fix `gmtime` issues in Win32
|
|
8416c9ad
|
2011-04-09T15:31:12
|
|
Rename `git_signature_new_now`
The new name is more cool.
|
|
9e9e6ae1
|
2011-04-05T16:15:54
|
|
Add API git_signature_new_now
Most tags will have a timestamp of whenever the code is running and
dealing with time and timezones is error-prone. Optimize for this case
by adding a function which causes the signature to be created with a
current timestamp.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
076141a1
|
2011-04-07T14:38:03
|
|
Add a few malloc checks
Add checks to see if malloc failed when allocating the tag members and
signature members.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
4a34b3a9
|
2011-04-09T15:49:44
|
|
Add two new accessors to the repository
git_repository_path() and git_repository_workdir() respectively return the path to the git repository and the working directory. Those paths are absolute and normalized.
|
|
c6e65aca
|
2011-04-09T15:22:11
|
|
Properly check `strtol` for errors
We are now using a custom `strtol` implementation to make sure we're not
missing any overflow errors.
|
|
41233c40
|
2011-04-08T12:42:18
|
|
Add new method `git_repository_is_empty`
|
|
d79f1da6
|
2011-04-08T12:14:33
|
|
refs: Fix issue when packing weak tags
Weak tags (e.g. tags that point directly to a normal object instead of a
tag object) were failing to be packed.
|
|
6ac247b3
|
2011-04-06T11:59:40
|
|
tag: don't check twice if an object exists
Remove the check in git_tag_create_frombuffer as it's done by
tag_create already.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
7bc66a79
|
2011-04-06T10:58:14
|
|
tag: don't allow tags to non-existent objects
These indicate an inconsistency in the repository which we've created,
so don't allow them.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
81234673
|
2011-04-05T16:53:32
|
|
tag: discover the target type if needed
Don't blindly pass the target type to git_tag_type2string as it will
give an empty string on GIT_OBJ_ANY which would cause us to create an
invalid tag object.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
5924b282
|
2011-04-06T10:48:31
|
|
Added git_commit_tree_oid and git_commit_parent_oid.
|
|
98ac6780
|
2011-04-06T02:22:24
|
|
fix git_treebuilder_insert probrem.
couldn't add new entry when inserting new one with `git_treebuilder_insert`.
|
|
5868cd02
|
2011-04-08T03:28:38
|
|
Do not assert error codes on Hiredis backend
We cannot assume that Redis is never going to return an error code; when
Reddit fails, we cannot crash our library, we need to handle the crash
gracefully.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
8a64bc29
|
2011-04-03T21:43:51
|
|
redis backend
|
|
b075b991
|
2011-04-07T16:54:10
|
|
Add getting and setting of long int variables
long int is a safer type than int unless the user knows that the
variable is going to be quite small.
The code has been reworked to use strtol instead of the more
complicated sscanf.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
7a4dfd60
|
2011-04-07T11:30:02
|
|
Simplify error path in config_set
Many error paths freed their local data althought it is freed later on
when the end of the function notices that there was an error. This can
cause double frees and invalid memory access.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
493384e3
|
2011-04-07T11:24:16
|
|
config: make cvar_free behave more like other free functions
Make cvar_free return void instad of the next element, as it was
mostly a hack to make cvar_list_free shorter but it's now using the
list macros.
Also check if the input is NULL and return immediately in that case.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
6b45cb8a
|
2011-04-06T18:27:31
|
|
config: use and implement list macros
Use list macros instead of manually changing the head and/or tail of
the variable list.
|
|
0d280ea4
|
2011-04-06T16:31:06
|
|
config: use snprintf instead of sprintf
Due to the preconditions, there should never be an error, but it pays
to be paranoid.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
956ad0ed
|
2011-04-06T15:51:10
|
|
config: free the file buffer earlier
There is no need to keep config file in memory until the the
configuration is freed. Free the buffer immediately after the
configuration has been parsed.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
8bd6c0ab
|
2011-04-06T15:49:29
|
|
Merge remote-tracking branch 'upstream/development' into config
|
|
acab3bc4
|
2011-04-06T15:31:42
|
|
config: move str(n)tolower to the git__ namespace
Non-static functions in a library should always have a prefix
namespace.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
aa793424
|
2011-04-06T15:27:12
|
|
config: coding style fixes
|
|
6776fd51
|
2011-04-06T15:17:06
|
|
config: really compare the variable name case-insensitively
Make cvar_name_match really compare the last part of the variable
ignoring the case.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
0ad6efa1
|
2011-04-04T19:24:19
|
|
Build & write custom trees in memory
|
|
2470be13
|
2011-04-04T17:06:31
|
|
config: variable name on its own means true
If a variable name appears on its own in a line, it's assumed the
value is true. Store the variable name as NULL in that case.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
9b7a6a99
|
2011-04-04T16:17:39
|
|
config: check for EOF before newline
If a line ends at EOF there is no need to check for the newline
character and doing so will cause us to read memory beyond the
allocatd memory as we check for the Windows-style new-line, which is
two bytes long.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
72946881
|
2011-04-04T15:26:43
|
|
config: support multiline values
If a variable value has the traditional continuation character (\) as
the last non-space character in the line, then we continue reading the
value on the next line.
Using more than two lines is also supported.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
2454ce78
|
2011-04-04T11:25:55
|
|
config: don't mix buffer reading methods
Make header and variable parse functions use their own buffers instead
of giving them the line they need to read as a parameter which they
mostly ignore.
This is in preparation for multiline configuration variables.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
9f1b54d6
|
2011-04-04T15:07:47
|
|
config: also free the file buffer on error
On error, the buffer containing the file contents also needs to be
freed.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
fe116e26
|
2011-04-04T15:33:14
|
|
config: Fix typo and remove debug statement
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
b153589b
|
2011-04-03T18:31:45
|
|
Make reinitializing a repository return GIT_ENOTIMPLEMENTED instead of GIT_SUCCESS
|
|
d69d0185
|
2011-04-04T13:05:20
|
|
Add a fake wstream to the ODB
Streaming writes will no longer fail when writing to a backend that
doesn't support streaming writes but supports direct ones.
Now we create a fake stream on memory and then write it as a single
block using the backend `write` callback.
|
|
29e1789b
|
2011-04-04T12:14:03
|
|
Fix the git_tree_write implementation
|
|
47d8ec56
|
2011-04-03T17:18:56
|
|
New external API method: `git_tree_create`
Creates a tree by scanning the index file. The method handles recursive
creation of trees for subdirectories and adds them to the parent tree.
|
|
3e3e4631
|
2011-04-02T12:49:14
|
|
Merge branch 'tagging' of https://github.com/nulltoken/libgit2 into development
Conflicts:
include/git2/tag.h
src/tag.c
|
|
720d5472
|
2011-04-02T12:42:04
|
|
Change `parse` methods to const buffer
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
d8ad64d3
|
2011-04-02T12:28:35
|
|
Merge branch 'parse-tag-buffer' of https://github.com/carlosmn/libgit2 into development
|
|
f026f2b9
|
2011-03-31T15:29:13
|
|
Merge upstream/development
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
11d0e705
|
2011-03-31T10:50:11
|
|
Add support for subsections
A variable name is stored internally with its section the way it
appeared in the configuration file in order to have the information
about what parts are case-sensitive inline.
Really implement parse_section_header_ext and move the assignment of
variables to config_parse.
The variable name matching is now done in a case-away way by
cvar_name_match and cvar_section_match. Before the user sees it, it's
normalized to the two- or three-dot version.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
923fe455
|
2011-03-30T16:02:57
|
|
Add strtolower and strntolower functions
As parts of variable names are case-sensitive, we need these functions.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
df22949a
|
2011-03-31T12:51:17
|
|
config_set: really replace the value on overwrite
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
6482929b
|
2011-03-30T18:51:02
|
|
move build_varname above parse_section
|
|
d7354d70
|
2011-03-30T16:22:31
|
|
build_varname: lowercase the variable name
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
0bbaf9aa
|
2011-03-30T16:11:55
|
|
config_parse: no need to check if current_section is non-null
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
ac26e245
|
2011-03-30T23:46:54
|
|
Rename git_tag_create_o_f() to git_tag_create_fo()
|
|
9e680bcc
|
2011-03-30T23:26:36
|
|
Add git_tag_delete()
|
|
a50c1458
|
2011-03-30T23:16:30
|
|
Add git_tag_create_o_f() and git_tag_create_f() which overwrite existing tag reference, if any
|
|
bf4c39f9
|
2011-03-30T22:30:55
|
|
Prevent tag_create() from creating a conflicting reference
|
|
8ecc5ae5
|
2011-03-30T16:48:14
|
|
git_config_set_int: use the right buffer
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
e21881d1
|
2011-03-30T15:16:25
|
|
git_config: reorder fields according to use
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
dadc0158
|
2011-03-30T15:05:15
|
|
config: use a singly-linked list instead of a hash table
Such a list preserves the order the variables were first read in which
will be useful later for merging different data-sets. Furthermore,
reading and writing out the same configuration should not reorganize
the variables, which could happen when iterating through all the items
in a hash table.
A hash table is overkill for this small a data-set anyway.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
d28830c2
|
2011-03-30T13:40:19
|
|
Store the parsed variables
Store the key-value pair as strings.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
934fcf78
|
2011-03-30T11:32:08
|
|
Initialise the config reader in config_parse
git_config_open shouldn't have to initialise variables that are only
used inside config_parse and its callees.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
2974aa94
|
2011-03-30T11:30:40
|
|
Determine variable type at runtime
Config variables should be interpreted at run-time, as we don't know if a
zero means false or zero, or if yes means true or "yes".
As a variable has no intrinsic type, git_cvtype is gone and the public
API takes care of enforcing a few rules.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
2e445cac
|
2011-03-30T11:07:09
|
|
build_varname: allocate memory
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
83c95128
|
2011-03-24T14:15:00
|
|
normalize_name: allow more references under refs/
Allow any well-formed reference name to live under refs/ removing the
condition that they be under refs/{heads,tags,remotes}/ as was the
design of git.
An exception is made for HEAD which is allowed to contain an OID
reference in detached HEAD state.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
9a53df7e
|
2011-03-29T19:40:02
|
|
refs: Don't allow references to inexistent OIDs
|
|
95cde17c
|
2011-03-29T19:22:21
|
|
Enforce coding conventions in refs.c
Internal methods are static and without the git prefix.
'Force' methods have a `_f` prefix to match the other 'force' methods.
|
|
dad4a4d5
|
2011-03-29T10:47:48
|
|
rename: don't return early if the target ref exists
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
fa204962
|
2011-03-28T12:00:50
|
|
Allow forcing the creation or renaming of references
Add internal reference create and rename functions which take a force
parameter, telling them to overwrite an existing reference if it
exists.
These functions try to update the reference if it's of the same type
as the one it's going to be replaced by. Otherwise the old reference
becomes invalid.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
baad182c
|
2011-03-28T11:31:58
|
|
Add GIT_EEXISTS error code
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
9a3c5e55
|
2011-03-29T17:44:10
|
|
Expose config API for setters, getters and foreach
These functions can be used to query or modify the variables in a
given configuration. No sanity checking is done on the variable names.
This is mostly meant as an API preview.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
26faa366
|
2011-03-29T17:59:13
|
|
Add build_varname to make a full var name
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
e15afc8e
|
2011-03-29T17:37:03
|
|
cvar_free: also free the config var's name
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
6d7bb4e0
|
2011-03-29T17:35:02
|
|
Move git_cvar_type to include/git2/config.h
Include it in src/config.h and fix the header name #define.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
3d23b74a
|
2011-03-29T13:50:37
|
|
Free the config var hash contents in git_config_free
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
238df559
|
2011-03-29T12:29:21
|
|
Rename git_config_{type,var} to git_cvar{_type,}
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
05314b5b
|
2011-03-29T12:25:46
|
|
Make GIT_EINVALIDTYPE available for use in config
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
9f7f4122
|
2011-03-29T12:19:53
|
|
Don't leak if config parsing fails
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
4e02504f
|
2011-03-29T12:10:30
|
|
Move config to support the new hash code
The hashes have been copied from the references code
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
483526eb
|
2011-03-28T22:23:44
|
|
Update the SQLite backend
|
|
3b4835c2
|
2011-03-28T18:07:22
|
|
Correctly parse the section header
If cfg_readline consumes the line, then parse_section_header will read
past it and if we read a character, parse_variable won't have the full
name.
This solution is a bit hackish, but it's the simplest way to get the
code to parse correctly.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
683581a3
|
2011-03-28T17:59:13
|
|
index.c: Fix tiny typos
|
|
908afb77
|
2011-03-28T17:53:04
|
|
parse_section_header: save the name where it belongs
Save the location of the name in section_out instead of returning it
as an int. Use the return code to signal success or failure.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
e4c796f1
|
2011-03-28T17:51:18
|
|
Read and parse the confguration when openingt the config file
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
a69053c7
|
2011-03-28T17:12:53
|
|
Convert config.c to LF
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
5d4cd003
|
2011-03-28T17:02:45
|
|
Move the struct declaration outside config.c
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
7b4a16e2
|
2011-03-28T13:59:48
|
|
Add git_tag_create_frombuffer API
Expose the tag parsing capabilities already present in the
library.
Exporting this function makes it possible to implement the
mktag command without duplicating this functionality.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
c15e0db5
|
2011-03-28T13:58:44
|
|
Fix memory leak in parse_tag_buffer
Free the allocated memory if the signature parsing reports an error.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
09e8de0f
|
2011-03-25T23:53:38
|
|
New external API method: `git_reference_listcb`
List all the references in the repository, calling a custom
callback for each one.
The listed references may be filtered by type, or using
a bitwise OR of several types. Use the magic value
`GIT_REF_LISTALL` to obtain all references, including
packed ones.
The `callback` function will be called for each of the references
in the repository, and will receive the name of the reference and
the `payload` value passed to this method.
|
|
3bdc0d4c
|
2011-03-24T15:32:24
|
|
index.c: Read index after initialization
The current behaviour of git_index_open{bare,inrepo}() is unexpected.
When an index is opened, an in-memory index object is created that is
linked to the index discovered by git_repository_open(). However, this
index object is empty, as the on-disk index is not read. To fully open
the on-disk index file, git_index_read() has to be called. This leads to
confusing behaviour. Consider the following code:
git_index *idx;
git_index_open_inrepo(&idx, repo);
git_index_write(idx);
You would expect this to have no effect, as the index is never
ostensibly manipulated. However, what actually happens is that the index
entries are removed from the on-disk index because the empty in-memory
index object created by open_inrepo() is written back to the disk.
This patch reads the index after opening it.
|
|
f6f72d7e
|
2011-03-23T18:44:53
|
|
Improve the ODB writing backend
Temporary files when doing streaming writes are now stored inside the
Objects folder, to prevent issues when moving files between
disks/partitions.
Add support for block writes to the ODB again (for those backends that
cannot implement streaming).
|
|
7c80c19e
|
2011-03-23T01:58:18
|
|
Fix compilation in MinGW
|
|
2b861d75
|
2011-03-19T08:31:40
|
|
Add detection of incorrect usage to git__joinpath()
|
|
3644e98f
|
2011-03-18T19:10:36
|
|
Fix detection of attempt to escape the root directory on Windows
|
|
c90292ce
|
2011-03-18T16:56:43
|
|
Change gitfo_prettify_dir_path() and gitfo_prettify_file_path() behavior
Those functions now return prettified rooted path.
|
|
6279abda
|
2011-03-17T06:56:58
|
|
Make gitfo_prettify_dir_path() and gitfo_prettify_file_path() no longer externalized
|
|
677a3c07
|
2011-03-15T22:07:01
|
|
Add failing test for issue 84
see https://github.com/libgit2/libgit2/issues#issue/84
|
|
ae6ba7f7
|
2011-03-22T19:45:01
|
|
Fix gitfo_mv() behavior when running on Windows
When the system temporary folder is located on a different volume than the working directory into which libgit2 is executing, MoveFileEx() requires an additional flag.
|
|
56d8ca26
|
2011-03-20T18:36:25
|
|
Switch from time_t to git_time_t
git_time_t is defined as a signed 64 integer. This allows a true predictable multiplatform behavior.
|
|
21d73e71
|
2011-03-22T20:26:01
|
|
Always free the parents of a revwalk commit
Thanks to Carlos Martín Nieto for spotting this.
|