1. 05 Jan, 2022 1 commit
  2. 09 Nov, 2021 1 commit
  3. 17 Oct, 2021 1 commit
    • str: introduce `git_str` for internal, `git_buf` is external · f0e693b1
      libgit2 has two distinct requirements that were previously solved by
      `git_buf`.  We require:
      
      1. A general purpose string class that provides a number of utility APIs
         for manipulating data (eg, concatenating, truncating, etc).
      2. A structure that we can use to return strings to callers that they
         can take ownership of.
      
      By using a single class (`git_buf`) for both of these purposes, we have
      confused the API to the point that refactorings are difficult and
      reasoning about correctness is also difficult.
      
      Move the utility class `git_buf` to be called `git_str`: this represents
      its general purpose, as an internal string buffer class.  The name also
      is an homage to Junio Hamano ("gitstr").
      
      The public API remains `git_buf`, and has a much smaller footprint.  It
      is generally only used as an "out" param with strict requirements that
      follow the documentation.  (Exceptions exist for some legacy APIs to
      avoid breaking callers unnecessarily.)
      
      Utility functions exist to convert a user-specified `git_buf` to a
      `git_str` so that we can call internal functions, then converting it
      back again.
      Edward Thomson committed
  4. 07 Feb, 2020 1 commit
  5. 10 Dec, 2019 6 commits
  6. 25 Nov, 2019 1 commit
  7. 15 Jun, 2019 1 commit
  8. 22 Jan, 2019 1 commit
  9. 01 Dec, 2018 1 commit
  10. 14 Nov, 2018 1 commit
  11. 08 Oct, 2018 1 commit
  12. 29 Jun, 2018 3 commits
    • settings: optional unsaved index safety · bfa1f022
      Add the `GIT_OPT_ENABLE_UNSAVED_INDEX_SAFETY` option, which will cause
      commands that reload the on-disk index to fail if the current
      `git_index` has changed that have not been saved.  This will prevent
      users from - for example - adding a file to the index then calling a
      function like `git_checkout` and having that file be silently removed
      from the index since it was re-read from disk.
      
      Now calls that would re-read the index will fail if the index is
      "dirty", meaning changes have been made to it but have not been written.
      Users can either `git_index_read` to discard those changes explicitly,
      or `git_index_write` to write them.
      Edward Thomson committed
    • index: return a unique error code on dirty index · 787768c2
      When the index is dirty, return GIT_EINDEXDIRTY so that consumers can
      identify the exact problem programatically.
      Edward Thomson committed
    • index: test dirty index bit · dc4a18c7
      Test that any changes to the index will mark the index as dirty.  Also
      ensure that when we initialize a new index, read the index contents
      from disk, or write the index contents to disk that we reset the dirty
      flag to zero.  Further ensure that an unforced read with dirty contents
      (when the on-disk index has not changed) does _not_ reset the dirty
      flag as we have not updated the contents of our index and our unsaved
      contents remain intact.
      Edward Thomson committed
  13. 10 Jun, 2018 1 commit
  14. 23 Jun, 2017 1 commit
    • tests: index::tests: create sandboxed repo for locking · 6ee7d37a
      The test `index::tests::can_lock_index` operates on the "testrepo.git"
      repository located inside of our source tree. While this is okay for
      tests which do read-only operations on these resouces, this specific
      test tries to lock the index by creating a lock. This will obviously
      fail on out-of-tree builds with read-only source trees.
      
      Fix the issue by creating a sandbox first.
      Patrick Steinhardt committed
  15. 17 Sep, 2015 1 commit
    • git_futils_mkdir_*: make a relative-to-base mkdir · ac2fba0e
      Untangle git_futils_mkdir from git_futils_mkdir_ext - the latter
      assumes that we own everything beneath the base, as if it were
      being called with a base of the repository or working directory,
      and is tailored towards checkout and ensuring that there is no
      bogosity beneath the base that must be cleaned up.
      
      This is (at best) slow and (at worst) unsafe in the larger context
      of a filesystem where we do not own things and cannot do things like
      unlink symlinks that are in our way.
      Edward Thomson committed
  16. 04 Sep, 2015 1 commit
  17. 14 Aug, 2015 1 commit
  18. 19 Jun, 2015 1 commit
  19. 25 Feb, 2015 1 commit
  20. 14 Feb, 2015 1 commit
  21. 18 Dec, 2014 3 commits
  22. 17 Dec, 2014 1 commit
  23. 16 Dec, 2014 1 commit
  24. 05 Dec, 2014 1 commit
  25. 01 Jul, 2014 1 commit
  26. 17 Apr, 2014 1 commit
  27. 04 Feb, 2014 2 commits
    • Fix typo setting sorted flag when reloading index · 43709ca8
      This fixes a typo I made for setting the sorted flag on the index
      after a reload.  That typo didn't actually cause any test failures
      so I'm also adding a test that explicitly checks that the index is
      correctly sorted after a reload when ignoring case and when not.
      Russell Belfer committed
    • Convert pqueue to just be a git_vector · 882c7742
      This updates the git_pqueue to simply be a set of specialized
      init/insert/pop functions on a git_vector.
      
      To preserve the pqueue feature of having a fixed size heap, I
      converted the "sorted" field in git_vectors to a more general
      "flags" field so that pqueue could mix in it's own flag.  This
      had a bunch of ramifications because a number of places were
      directly looking at the vector "sorted" field - I added a couple
      new git_vector helpers (is_sorted, set_sorted) so the specific
      representation of this information could be abstracted.
      Russell Belfer committed
  28. 25 Jan, 2014 1 commit
  29. 19 Nov, 2013 2 commits