1. 10 Apr, 2018 1 commit
  2. 12 Jan, 2018 1 commit
  3. 03 Jul, 2017 1 commit
    • Make sure to always include "common.h" first · 0c7f49dd
      Next to including several files, our "common.h" header also declares
      various macros which are then used throughout the project. As such, we
      have to make sure to always include this file first in all
      implementation files. Otherwise, we might encounter problems or even
      silent behavioural differences due to macros or defines not being
      defined as they should be. So in fact, our header and implementation
      files should make sure to always include "common.h" first.
      
      This commit does so by establishing a common include pattern. Header
      files inside of "src" will now always include "common.h" as its first
      other file, separated by a newline from all the other includes to make
      it stand out as special. There are two cases for the implementation
      files. If they do have a matching header file, they will always include
      this one first, leading to "common.h" being transitively included as
      first file. If they do not have a matching header file, they instead
      include "common.h" as first file themselves.
      
      This fixes the outlined problems and will become our standard practice
      for header and source files inside of the "src/" from now on.
      Patrick Steinhardt committed
  4. 05 Apr, 2017 1 commit
    • refs: implement function to read references from file · 5b65ac25
      Currently, we only provide functions to read references directly from a
      repository's reference store via e.g. `git_reference_lookup`. But in
      some cases, we may want to read files not connected to the current
      repository, e.g. when looking up HEAD of connected work trees. This
      commit implements `git_reference__read_head`, which will read out and
      allocate a reference at an arbitrary path.
      Patrick Steinhardt committed
  5. 21 Jan, 2017 1 commit
  6. 27 Aug, 2016 1 commit
    • Make symbolic ref target validation optional · 452bf57c
      Introduce GIT_OPT_ENABLE_SYMBOLIC_REF_TARGET_VALIDATION option.
      Setting this option to 0 allows
      validation of a symbolic ref's target to be bypassed.
      This option is enabled by default.
      
      This mechanism is added primarily to address a discrepancy between git
      behaviour and libgit2 behaviour, whereby the former allows the symbolic
      ref target to carry an arbitrary string and the latter does not, so:
      
          $ git symbolic-ref refs/heads/foo bar
          $ cat .git/refs/heads/foo
          ref: bar
      
      where as attempting the same via libgit2 raises an error:
      
          The given reference name 'bar' is not valid
      
      this mechanism also allows those that might want to make use of
      git's more lenient treatment of symbolic ref targets to do so.
      Richard Ipsum committed
  7. 20 Nov, 2015 1 commit
  8. 03 Mar, 2015 2 commits
  9. 27 Oct, 2014 1 commit
  10. 30 Sep, 2014 1 commit
    • Introduce reference transactions · ab8d9242
      A transaction allows you to lock multiple references and set up changes
      for them before applying the changes all at once (or as close as the
      backend supports).
      
      This can be used for replication purposes, or for making sure some
      operations run when the reference is locked and thus cannot be changed.
      Carlos Martín Nieto committed
  11. 22 Jul, 2014 1 commit
  12. 26 Jun, 2014 1 commit
  13. 30 May, 2014 2 commits
  14. 15 Jan, 2014 1 commit
  15. 09 Dec, 2013 1 commit
  16. 08 Oct, 2013 1 commit
    • Make reference lookups apply precomposeunicode · 92dac975
      Before these changes, looking up a reference would return the
      same precomposed or decomposed form of the reference name that
      was used to look it up, so on MacOS which ignores the difference
      between the two, a single reference could be looked up either way
      and git_reference_name would return the form of the name that was
      used to look it up!  This change makes lookup always return the
      precomposed name if core.precomposeunicode is set regardless of
      which version was used to look it up.  The reference iterator was
      already returning the precomposed form from earlier work.
      
      This also updates the CMakeLists.txt rules for enabling iconv
      usage because the clar tests for this code were actually not being
      activated properly with the old version.
      
      Finally, this moves git_repository_reset_filesystem from include/
      git2/repository.h to include/git2/sys/repository.h since it is not
      really a function that normal library users should have to think
      about very often.
      Russell Belfer committed
  17. 26 Aug, 2013 1 commit
  18. 21 Aug, 2013 1 commit
    • Add internal ref set_name fn instead of realloc · 24c71f14
      The refdb_fs implementation calls realloc directly on a reference
      object when it wants to rename it.  It is not a public object, so
      this doesn't mess with the immutability of references, but it does
      assume certain constraints on the reference representation.  This
      commit wraps that assumption in an isolated API to isolate it.
      Russell Belfer committed
  19. 02 May, 2013 2 commits
  20. 29 Apr, 2013 1 commit
  21. 17 Apr, 2013 2 commits
  22. 07 Mar, 2013 1 commit
  23. 22 Feb, 2013 1 commit
  24. 16 Jan, 2013 1 commit
  25. 08 Jan, 2013 1 commit
  26. 27 Oct, 2012 1 commit
  27. 26 Oct, 2012 1 commit
  28. 25 Oct, 2012 1 commit
  29. 25 Sep, 2012 3 commits
  30. 07 Jun, 2012 1 commit
  31. 25 Apr, 2012 2 commits
    • Rename git_khash_str to git_strmap, etc. · c2b67043
      This renamed `git_khash_str` to `git_strmap`, `git_hash_oid` to
      `git_oidmap`, and deletes `git_hashtable` from the tree, plus
      adds unit tests for `git_strmap`.
      Russell Belfer committed
    • Convert hashtable usage over to khash · 01fed0a8
      This updates khash.h with some extra features (like error checking
      on allocations, ability to use wrapped malloc, foreach calls, etc),
      creates two high-level wrappers around khash: `git_khash_str` and
      `git_khash_oid` for string-to-void-ptr and oid-to-void-ptr tables,
      then converts all of the old usage of `git_hashtable` over to use
      these new hashtables.
      
      For `git_khash_str`, I've tried to create a set of macros that
      yield an API not too unlike the old `git_hashtable` API.  Since
      the oid hashtable is only used in one file, I haven't bother to
      set up all those macros and just use the khash APIs directly for
      now.
      Russell Belfer committed
  32. 17 Apr, 2012 1 commit
    • Add git_reference_lookup_oid and lookup_resolved · f201d613
      Adds a new public reference function `git_reference_lookup_oid`
      that directly resolved a reference name to an OID without returning
      the intermediate `git_reference` object (hence, no free needed).
      
      Internally, this adds a `git_reference_lookup_resolved` function
      that combines looking up and resolving a reference.  This allows
      us to be more efficient with memory reallocation.
      
      The existing `git_reference_lookup` and `git_reference_resolve`
      are reimplmented on top of the new utility and a few places in the
      code are changed to use one of the two new functions.
      Russell Belfer committed
  33. 13 Feb, 2012 1 commit