1. 27 Nov, 2020 1 commit
  2. 12 Jul, 2020 5 commits
    • refdb: avoid unlimited spinning in case of symref cycles · 34987447
      To determine whether another reflog entry needs to be written for HEAD
      on a reference update, we need to see whether HEAD directly or
      indirectly points to the reference we're updating. The resolve logic is
      currently completely unbounded except an error occurs, which effectively
      means that we'd be spinning forever in case we have a symref loop in the
      repository refdb.
      
      Let's fix the issue by using `git_refdb_resolve` instead, which is
      always bounded.
      Patrick Steinhardt committed
    • refdb: return resolved symbolic refs pointing to nonexistent refs · cf7dd05b
      In some cases, resolving references requires us to also know about the
      final symbolic reference that's pointing to a nonexistent branch, e.g.
      in an empty repository where the main branch is yet unborn but HEAD
      already points to it. Right now, the resolving logic is thus split up
      into two, where one is the new refdb implementation and the second one
      is an ad-hoc implementation inside "refs.c".
      
      Let's extend `git_refdb_resolve` to also return such final dangling
      references pointing to nonexistent branches so we can deduplicate the
      resolving logic.
      Patrick Steinhardt committed
    • refs: move resolving of references into the refdb · c54f40e4
      Resolving of symbolic references is currently implemented inside the
      "refs" layer. As a result, it's hard to call this function from
      low-level parts that only have a refdb available, but no repository, as
      the "refs" layer always operates on the repository-level. So let's move
      the function into the generic "refdb" implementation to lift this
      restriction.
      Patrick Steinhardt committed
    • refdb: extract function to check whether to append HEAD to the reflog · 1f39593b
      The logic to determine whether a reflog entry should be for the HEAD
      reference is non-trivial. Currently, the only user of this is the
      filesystem-based refdb, but with the advent of the reftable refdb we're
      going to add a second user that's interested in having the same
      behaviour.
      
      Let's pull out a new function that checks whether a given reference
      should cause a entry to be written to the HEAD reflog as a preparatory
      step.
      Patrick Steinhardt committed
    • refdb: extract function to check whether a reflog should be written · e02478b1
      The logic to determine whether a reflog should be written is
      non-trivial. Currently, the only user of this is the filesystem-based
      refdb, but with the advent of the reftable refdb we're going to add a
      second user that's interested in having the same behaviour.
      
      Let's pull out a new function that checks whether a given reference
      should cause a reflog to be written as a preparatory step.
      Patrick Steinhardt committed
  3. 05 Sep, 2019 2 commits
  4. 22 Jan, 2019 1 commit
  5. 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
  6. 29 Dec, 2016 1 commit
  7. 14 Nov, 2016 1 commit
  8. 30 Sep, 2015 1 commit
    • refdb and odb backends must provide `free` function · d3b29fb9
      As refdb and odb backends can be allocated by client code, libgit2
      can’t know whether an alternative memory allocator was used, and thus
      should not try to call `git__free` on those objects.
      
      Instead, odb and refdb backend implementations must always provide
      their own `free` functions to ensure memory gets freed correctly.
      Arthur Schreiber committed
  9. 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
  10. 02 May, 2014 1 commit
  11. 06 Mar, 2014 1 commit
  12. 05 Feb, 2014 3 commits
  13. 09 Dec, 2013 2 commits
  14. 23 Nov, 2013 2 commits
  15. 02 Oct, 2013 1 commit
  16. 24 Sep, 2013 1 commit
  17. 12 Jun, 2013 1 commit
  18. 07 Jun, 2013 1 commit
  19. 31 May, 2013 1 commit
  20. 30 May, 2013 2 commits
  21. 29 May, 2013 1 commit
  22. 28 May, 2013 1 commit
  23. 11 May, 2013 4 commits
  24. 21 Apr, 2013 2 commits
  25. 19 Apr, 2013 1 commit
  26. 12 Apr, 2013 1 commit