Commits on Dec 14, 2011
  1. Allow git_buf_joinpath to accept self-joins

    It was not safe for git_buf_joinpath to be used with a pointer
    into the buf itself because a reallocation could invalidate
    the input parameter that pointed into the buffer.  This patch
    makes it safe to self join, at least for the leading input to
    the join, which is the common "append" case for self joins.
    Also added unit tests to explicitly cover this case.
    This should actually fix #511
    committed Dec 14, 2011
  2. Check error on path manipulations.

    This commit fixes #511.
    committed Dec 14, 2011
  3. @vmg

    Merge remote-tracking branch 'nulltoken/topic/oid-generation' into de…

    vmg committed Dec 14, 2011
  4. @vmg

    buffer: inline `git_buf_cstr`

    vmg committed Dec 14, 2011
  5. @vmg

    Fix tree-diff with the new path API

    vmg committed Dec 14, 2011
Commits on Dec 9, 2011
  1. @vmg

    Merge remote-tracking branch 'arrbee/git-buf-for-paths' into development

    vmg committed Dec 9, 2011
Commits on Dec 8, 2011
  1. Use git_buf for path storage instead of stack-based buffers

    This converts virtually all of the places that allocate GIT_PATH_MAX
    buffers on the stack for manipulating paths to use git_buf objects
    instead.  The patch is pretty careful not to touch the public API
    for libgit2, so there are a few places that still use GIT_PATH_MAX.
    This extends and changes some details of the git_buf implementation
    to add a couple of extra functions and to make error handling easier.
    This includes serious alterations to all the path.c functions, and
    several of the fileops.c ones, too.  Also, there are a number of new
    functions that parallel existing ones except that use a git_buf
    instead of a stack-based buffer (such as git_config_find_global_r
    that exists alongsize git_config_find_global).
    This also modifies the win32 version of p_realpath to allocate whatever
    buffer size is needed to accommodate the realpath instead of hardcoding
    a GIT_PATH_MAX limit, but that change needs to be tested still.
    committed Nov 30, 2011
Commits on Dec 4, 2011
  1. @nulltoken
Commits on Dec 3, 2011
  1. @vmg

    tree: recursive diff-index

    Signed-off-by: Carlos Martín Nieto <>
    Signed-off-by: Vicent Marti <>
    # Please enter the commit message for your changes. Lines starting
    # with '#' will be ignored, and an empty message aborts the commit.
    # Author:    Carlos Martín Nieto <>
    # On branch development
    # Your branch is ahead of 'origin/development' by 11 commits.
    # Changes to be committed:
    #   (use "git reset HEAD^1 <file>..." to unstage)
    #	modified:   include/git2/tree.h
    #	modified:   src/tree.c
    #	modified:   tests-clay/clay_main.c
    #	modified:   tests-clay/object/tree/diff.c
    # Untracked files:
    #   (use "git add <file>..." to include in what will be committed)
    #	0001-remote-Cleanup-the-remotes-code.patch
    #	466.patch
    #	466.patch.1
    #	488.patch
    #	Makefile
    #	libgit2.0.15.0.dylib
    #	libgit2.0.dylib
    #	libgit2.dylib
    #	libgit2_clay
    #	libgit2_test
    #	tests-clay/object/tree/
    vmg committed Dec 3, 2011
  2. @carlosmn @vmg

    clay: add tests for tree diff'ing

    Signed-off-by: Carlos Martín Nieto <>
    Signed-off-by: Vicent Marti <>
    carlosmn committed with vmg Oct 26, 2011
  3. @carlosmn @vmg

    tree: implement tree diffing

    For each difference in the trees, the callback gets called with the
    relevant information so the user can fill in their own data
    Signed-off-by: Carlos Martín Nieto <>
    carlosmn committed with vmg Oct 24, 2011
Commits on Dec 1, 2011
  1. @vmg

    Merge pull request #506 from nulltoken/fix/warnings

    Fix compilation warnings
    vmg committed Dec 1, 2011
  2. @nulltoken

    Fix compilation warnings

    nulltoken committed Dec 1, 2011
Commits on Nov 30, 2011
  1. @vmg

    Merge pull request #504 from arrbee/git-buf-fast-join

    Optimized implementation of git_buf_join
    vmg committed Nov 30, 2011
  2. Optimized of git_buf_join.

    This streamlines git_buf_join and removes the join-append behavior,
    opting instead for a very compact join-replace of the git_buf contents.
    The unit tests had to be updated to remove the join-append tests and
    have a bunch more exhaustive tests added.
    committed Nov 30, 2011
  3. @vmg

    Merge pull request #503 from arrbee/git-buf-always-cstr

    Make git_buf functions always maintain a valid cstr
    vmg committed Nov 30, 2011
  4. Make initial value of git_buf ptr always be a valid empty string.

    Taking a page from core git's strbuf, this introduces git_buf_initbuf
    which is an empty string that is used to initialize the git_buf ptr
    value even for new buffers.  Now the git_buf ptr will always point to
    a valid NUL-terminated string.
    This change required jumping through a few hoops for git_buf_grow
    and git_buf_free to distinguish between a actual allocated buffer
    and the global initial value.  Also, this moves the allocation
    related functions to be next to each other near the top of buffer.c.
    committed Nov 30, 2011
  5. Make git_buf functions always maintain a valid cstr.

    At a tiny cost of 1 extra byte per allocation, this makes
    git_buf_cstr into basically a noop, which simplifies error
    checking when trying to convert things to use dynamic allocation.
    This patch also adds a new function (git_buf_copy_cstr) for copying
    the cstr data directly into an external buffer.
    committed Nov 30, 2011
Commits on Nov 29, 2011
  1. @vmg

    Merge pull request #500 from schu/minor-fixups

    Minor fixups
    vmg committed Nov 29, 2011
  2. @vmg

    clay: Add buffer tests

    vmg committed Nov 29, 2011
  3. tests-clay: mix the tests

    Actually add the tests introduced with 8c74d22.
    Signed-off-by: schu <>
    schu committed Nov 29, 2011
  4. transports: fix -Wunused-but-set-variable warning

    Signed-off-by: schu <>
    schu committed Nov 29, 2011
  5. @vmg

    Merge pull request #499 from arrbee/extend-git-buf

    Extend git_buf with new utility functions and unit tests.
    vmg committed Nov 29, 2011
Commits on Nov 28, 2011
  1. Resolve remaining feedback

    * replace some ints with size_ts
    * update NULL checks in various places
    committed Nov 28, 2011
  2. @carlosmn

    Plug a bunch of leaks

    carlosmn committed Nov 28, 2011
  3. @vmg
  4. Add two string git_buf_join and tweak input error checking.

    This commit addresses two of the comments:
    * renamed existing n-input git_buf_join to git_buf_join_n
    * added new git_buf_join that always takes two inputs
    * moved some parameter error checking to asserts
    * extended unit tests to cover new version of git_buf_join
    committed Nov 28, 2011
  5. @vmg

    remote: Fix connected test

    vmg committed Nov 28, 2011
  6. @vmg
  7. @vmg

    remote: Cleanup the remotes code

    - Hide the remaining transports code
    - Drop `git_headarray`, switch to using a callback to list refs. Makes
    the code cleaner.
    vmg committed Nov 28, 2011
  8. Extend git_buf with new utility functions and unit tests.

    Add new functions to git_buf for:
    * initializing a buffer from a string
    * joining one or more strings onto a buffer with separators
    * swapping two buffers in place
    * extracting data from a git_buf (leaving it empty)
    Also, make git_buf_free leave a git_buf back in its initted state,
    and slightly tweak buffer allocation sizes and thresholds.
    Finally, port unit tests to clay and extend with lots of new tests
    for the various git_buf functions.
    committed Nov 28, 2011
Commits on Nov 26, 2011
  1. @vmg

    repository: Use `git_config` when initializing

    Thanks @carlosmn!
    vmg committed Nov 26, 2011
  2. @vmg

    util: Remove unused macro

    vmg committed Nov 26, 2011
  3. @vmg

    refcount: Fix off-by one error

    vmg committed Nov 26, 2011