1. 10 Mar, 2018 1 commit
    • refs: do not use peeled OID if peeling to a tag · cda18f9b
      If a reference stored in a packed-refs file does not directly point to a
      commit, tree or blob, the packed-refs file will also will include a
      fully-peeled OID pointing to the first underlying object of that type.
      If we try to peel a reference to an object, we will use that peeled OID
      to speed up resolving the object.
      
      As a reference for an annotated tag does not directly point to a commit,
      tree or blob but instead to the tag object, the packed-refs file will
      have an accomodating fully-peeled OID pointing to the object referenced
      by that tag. When we use the fully-peeled OID pointing to the referenced
      object when peeling, we obviously cannot peel that to the tag anymore.
      
      Fix this issue by not using the fully-peeled OID whenever we want to
      peel to a tag. Note that this does not include the case where we want to
      resolve to _any_ object type. Existing code may make use from the fact
      that we resolve those to commit objects instead of tag objects, even
      though that behaviour is inconsistent between packed and loose
      references. Furthermore, some tests of ours make the assumption that we
      in fact resolve those references to a commit.
      Patrick Steinhardt committed
  2. 08 Jun, 2017 1 commit
  3. 01 May, 2017 1 commit
  4. 05 Apr, 2017 2 commits
    • refs: update worktree HEADs when renaming branches · 2a485dab
      Whenever we rename a branch, we update the repository's symbolic HEAD
      reference if it currently points to the branch that is to be renamed.
      But with the introduction of worktrees, we also have to iterate over all
      HEADs of linked worktrees to adjust them. Do so.
      Patrick Steinhardt committed
    • 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. 27 Feb, 2017 1 commit
  6. 17 Feb, 2017 1 commit
  7. 21 Jan, 2017 1 commit
  8. 29 Dec, 2016 1 commit
  9. 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
  10. 22 Apr, 2016 1 commit
  11. 11 Apr, 2016 1 commit
  12. 28 Feb, 2016 1 commit
  13. 15 Jun, 2015 1 commit
  14. 24 Mar, 2015 1 commit
  15. 03 Mar, 2015 3 commits
  16. 15 Feb, 2015 1 commit
  17. 13 Feb, 2015 3 commits
  18. 27 Oct, 2014 1 commit
  19. 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
  20. 30 May, 2014 2 commits
  21. 03 Apr, 2014 1 commit
  22. 17 Mar, 2014 1 commit
  23. 10 Feb, 2014 1 commit
  24. 05 Feb, 2014 7 commits
  25. 03 Feb, 2014 1 commit
  26. 02 Feb, 2014 1 commit
  27. 30 Jan, 2014 2 commits