1. 10 Jul, 2013 1 commit
    • Add BARE option to git_repository_open_ext · 3fe046cf
      This adds a BARE option to git_repository_open_ext which allows
      a fast open path that still knows how to read gitlinks and to
      search for the actual .git directory from a subdirectory.
      
      `git_repository_open_bare` is still simpler and faster, but having
      a gitlink aware fast open is very useful for submodules where we
      want to quickly be able to peek at the HEAD and index data without
      doing any other meaningful repo operations.
      Russell Belfer committed
  2. 07 May, 2013 1 commit
    • repo: unconditionally create a global config backend · a4b75dcf
      When a repository is initialised, we need to probe to see if there is
      a global config to load. If this is not the case, the user isn't able
      to write to the global config without creating the backend and adding
      it themselves, which is inconvenient and overly complex.
      
      Unconditionally create and add a backend for the global config file
      regardless of whether it exists as a convenience for users.
      
      To enable this, we allow creating backends to files that do not exist
      yet, changing the semantics somewhat, and making some tests invalid.
      Carlos Martín Nieto committed
  3. 30 Apr, 2013 1 commit
  4. 09 Nov, 2012 1 commit
    • Extensions to rmdir and mkdir utilities · 331e7de9
      * Rework GIT_DIRREMOVAL values to GIT_RMDIR flags, allowing
        combinations of flags
      * Add GIT_RMDIR_EMPTY_PARENTS flag to remove parent dirs that
        are left empty after removal
      * Add GIT_MKDIR_VERIFY_DIR to give an error if item is a file,
        not a dir (previously an EEXISTS error was ignored, even for
        files) and enable this flag for git_futils_mkpath2file call
      * Improve accuracy of error messages from git_futils_mkdir
      Russell Belfer committed
  5. 09 Oct, 2012 1 commit
    • Add complex checkout test and then fix checkout · 0d64bef9
      This started as a complex new test for checkout going through the
      "typechanges" test repository, but that revealed numerous issues
      with checkout, including:
      
      * complete failure with submodules
      * failure to create blobs with exec bits
      * problems when replacing a tree with a blob because the tree
        "example/" sorts after the blob "example" so the delete was
        being processed after the single file blob was created
      
      This fixes most of those problems and includes a number of other
      minor changes that made it easier to do that, including improving
      the TYPECHANGE support in diff/status, etc.
      Russell Belfer committed
  6. 17 May, 2012 2 commits
  7. 08 May, 2012 2 commits
  8. 17 Apr, 2012 1 commit
  9. 15 Apr, 2012 1 commit
  10. 14 Apr, 2012 1 commit
  11. 11 Apr, 2012 1 commit
    • Refactor git_repository_open with new options · 7784bcbb
      Add a new command `git_repository_open_ext` with extended options
      that control how searching for a repository will be done.  The
      existing `git_repository_open` and `git_repository_discover` are
      reimplemented on top of it.  We may want to change the default
      behavior of `git_repository_open` but this commit does not do that.
      
      Improve support for "gitdir" files where the work dir is separate
      from the repo and support for the "separate-git-dir" config.  Also,
      add support for opening repos created with `git-new-workdir` script
      (although I have only confirmed that they can be opened, not that
      all functions work correctly).
      
      There are also a few minor changes that came up:
      
      - Fix `git_path_prettify` to allow in-place prettifying.
      
      - Fix `git_path_root` to support backslashes on Win32.  This fix
        should help many repo open/discover scenarios - it is the one
        function called when opening before prettifying the path.
      
      - Tweak `git_config_get_string` to set the "out" pointer to NULL
        if the config value is not found.  Allows some other cleanup.
      
      - Fix a couple places that should have been calling
        `git_repository_config__weakptr` and were not.
      
      - Fix `cl_git_sandbox_init` clar helper to support bare repos.
      Russell Belfer committed
  12. 03 Feb, 2012 1 commit
  13. 25 Jan, 2012 2 commits
  14. 08 Dec, 2011 1 commit
    • Use git_buf for path storage instead of stack-based buffers · 97769280
      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.
      Russell Belfer committed
  15. 26 Nov, 2011 1 commit
    • repository: Change ownership semantics · 9462c471
      The ownership semantics have been changed all over the library to be
      consistent. There are no more "borrowed" or duplicated references.
      
      Main changes:
      
      	- `git_repository_open2` and `3` have been dropped.
      
      	- Added setters and getters to hotswap all the repository owned
      	objects:
      
      		`git_repository_index`
      		`git_repository_set_index`
      		`git_repository_odb`
      		`git_repository_set_odb`
      		`git_repository_config`
      		`git_repository_set_config`
      		`git_repository_workdir`
      		`git_repository_set_workdir`
      
      	Now working directories/index files/ODBs and so on can be
      	hot-swapped after creating a repository and between operations.
      
      	- All these objects now have proper ownership semantics with
      	refcounting: they all require freeing after they are no longer
      	needed (the repository always keeps its internal reference).
      
      	- Repository open and initialization has been updated to keep in
      	mind the configuration files. Bare repositories are now always
      	detected, and a default config file is created on init.
      
      	- All the tests affected by these changes have been dropped from the
      	old test suite and ported to the new one.
      Vicent Marti committed