1. 22 Feb, 2019 1 commit
  2. 14 Feb, 2019 3 commits
    • branch: fix `branch_is_checked_out` with bare repos · bf013fc0
      In a bare repository, HEAD usually points to the branch that is
      considered the "default" branch. As the current implementation for
      `git_branch_is_checked_out` only does a comparison of HEAD with the
      branch that is to be checked, it will say that the branch pointed to by
      HEAD in such a bare repo is checked out.
      
      Fix this by skipping the main repo's HEAD when it is bare.
      Patrick Steinhardt committed
    • branches: do not assert that the given ref is a branch · 788cd2d5
      Libraries should use assert(3P) only very scarcely. First, we usually
      shouldn't cause the caller of our library to abort in case where the
      assert fails. Second, if code is compiled with -DNDEBUG, then the assert
      will not be included at all.
      
      In our `git_branch_is_checked_out` function, we have an assert that
      verifies that the given reference parameter is non-NULL and in fact a
      branch. While the first check is fine, the second is not. E.g. when
      compiled with -DNDEBUG, we'd proceed and treat the given reference as a
      branch in all cases.
      
      Fix the issue by instead treating a non-branch reference as not being
      checked out. This is the obvious solution, as references other than
      branches cannot be directly checked out.
      Patrick Steinhardt committed
    • branches: add tests for `git_branch_is_checked_out` · a0f87e16
      We currently do not have any tests at all for the
      `git_branch_is_checked_out` function. Add some basic ones.
      Patrick Steinhardt committed
  3. 22 Jan, 2019 1 commit
  4. 17 Jan, 2019 1 commit
  5. 01 Dec, 2018 1 commit
  6. 18 Nov, 2018 1 commit
  7. 13 Oct, 2018 1 commit
  8. 13 Jul, 2018 1 commit
    • treewide: remove use of C++ style comments · 9994cd3f
      C++ style comment ("//") are not specified by the ISO C90 standard and
      thus do not conform to it. While libgit2 aims to conform to C90, we did
      not enforce it until now, which is why quite a lot of these
      non-conforming comments have snuck into our codebase. Do a tree-wide
      conversion of all C++ style comments to the supported C style comments
      to allow us enforcing strict C90 compliance in a later commit.
      Patrick Steinhardt committed
  9. 10 Jun, 2018 1 commit
  10. 01 Jun, 2018 1 commit
  11. 04 May, 2018 1 commit
  12. 10 Apr, 2018 1 commit
  13. 24 Feb, 2018 1 commit
  14. 12 Jan, 2018 1 commit
  15. 30 Dec, 2017 1 commit
  16. 22 Nov, 2017 1 commit
  17. 14 Nov, 2017 4 commits
  18. 06 Oct, 2017 1 commit
    • refs: do not use peeled OID if peeling to a tag · b112b1e9
      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
  19. 23 Jun, 2017 1 commit
  20. 08 Jun, 2017 1 commit
    • settings: rename `GIT_OPT_ENABLE_SYNCHRONOUS_OBJECT_CREATION` · 6c23704d
      Initially, the setting has been solely used to enable the use of
      `fsync()` when creating objects. Since then, the use has been extended
      to also cover references and index files. As the option is not yet part
      of any release, we can still correct this by renaming the option to
      something more sensible, indicating not only correlation to objects.
      
      This commit renames the option to `GIT_OPT_ENABLE_FSYNC_GITDIR`. We also
      move the variable from the object to repository source code.
      Patrick Steinhardt committed
  21. 05 May, 2017 1 commit
  22. 06 Mar, 2017 1 commit
  23. 02 Mar, 2017 1 commit
  24. 01 Mar, 2017 1 commit
  25. 28 Feb, 2017 6 commits
  26. 25 Feb, 2017 2 commits
  27. 13 Feb, 2017 2 commits
  28. 29 Dec, 2016 1 commit