1. 26 May, 2016 3 commits
  2. 03 May, 2016 1 commit
    • diff: simplify code for handling empty dirs · fe3057b4
      When determining diffs between two iterators we may need to
      recurse into an unmatched directory for the "new" iterator when
      it is either a prefix to the current item of the "old" iterator
      or when untracked/ignored changes are requested by the user and
      the directory is untracked/ignored.
      
      When advancing into the directory and no files are found, we will
      get back `GIT_ENOTFOUND`. If so, we simply skip the directory,
      handling resulting unmatched old items in the next iteration. The
      other case of `iterator_advance_into` returning either
      `GIT_NOERROR` or any other error but `GIT_ENOTFOUND` will be
      handled by the caller, which will now either compare the first
      directory entry of the "new" iterator in case of `GIT_ENOERROR`
      or abort on other cases.
      
      Improve readability of the code to make the above logic more
      clear.
      Patrick Steinhardt committed
  3. 24 Mar, 2016 1 commit
  4. 23 Mar, 2016 2 commits
    • diff: stop processing nitem when its removed · 67885532
      When a directory is removed out from underneath us, stop trying to
      manipulate it.
      Edward Thomson committed
    • iterator: combine fs+workdir iterators more completely · 0e0589fc
      Drop some of the layers of indirection between the workdir and the
      filesystem iterators.  This makes the code a little bit easier to
      follow, and reduces the number of unnecessary allocations a bit as
      well.  (Prior to this, when we filter entries, we would allocate them,
      filter them and then free them; now we do the filtering before
      allocation.)
      
      Also, rename `git_iterator_advance_over_with_status` to just
      `git_iterator_advance_over`.  Mostly because it's a fucking long-ass
      function name otherwise.
      Edward Thomson committed
  5. 11 Feb, 2016 1 commit
  6. 01 Dec, 2015 1 commit
  7. 23 Nov, 2015 1 commit
    • checkout: only consider nsecs when built that way · 25e84f95
      When examining the working directory and determining whether it's
      up-to-date, only consider the nanoseconds in the index entry when
      built with `GIT_USE_NSEC`.  This prevents us from believing that
      the working directory is always dirty when the index was originally
      written with a git client that uinderstands nsecs (like git 2.x).
      Edward Thomson committed
  8. 02 Nov, 2015 1 commit
  9. 28 Oct, 2015 1 commit
  10. 22 Oct, 2015 1 commit
    • diff: ignore nsecs when diffing · 7499eae9
      Although our index contains the literal time present in the index,
      we do not read nanoseconds from disk, and thus we should not use
      them in any comparisons, lest we always think our working directory
      is dirty.
      
      Guard this behind a `GIT_USE_NSECS` for future improvement.
      Edward Thomson committed
  11. 02 Oct, 2015 1 commit
  12. 19 Sep, 2015 2 commits
  13. 12 Sep, 2015 1 commit
    • diff: check pathspec on non-files · 8ab4d0e1
      When we're not doing pathspec matching, we let the iterator handle
      file matching for us.  However, we can only trust the iterator to
      return *files* that match the pattern, because the iterator must
      return directories that are not strictly in the pathlist, but that
      are the parents of files that match the pattern, so that diff can
      later recurse into them.
      
      Thus, diff must examine non-files explicitly before including them
      in the delta list.
      Edward Thomson committed
  14. 30 Aug, 2015 1 commit
    • diff: use new iterator pathlist handling · 4a0dbeb0
      When using literal pathspecs in diff with `GIT_DIFF_DISABLE_PATHSPEC_MATCH`
      turn on the faster iterator pathlist handling.
      
      Updates iterator pathspecs to include directory prefixes (eg, `foo/`)
      for compatibility with `GIT_DIFF_DISABLE_PATHSPEC_MATCH`.
      Edward Thomson committed
  15. 28 Aug, 2015 2 commits
  16. 30 Jun, 2015 1 commit
  17. 26 Jun, 2015 1 commit
  18. 23 Jun, 2015 1 commit
    • Fixed GIT_DELTA_CONFLICTED not returned in some cases · 8d8a2eef
      If an index entry for a file that is not in HEAD is in conflicted state,
      when diffing HEAD with the index, the status field of the corresponding git_diff_delta was incorrectly reported as GIT_DELTA_ADDED instead of GIT_DELTA_CONFLICTED.
      
      This was due to handle_unmatched_new_item() initially setting the status
      to GIT_DELTA_CONFLICTED but then overriding it later with GIT_DELTA_ADDED.
      Pierre-Olivier Latour committed
  19. 22 Jun, 2015 1 commit
    • diff: check files with the same or newer timestamps · ff475375
      When a file on the workdir has the same or a newer timestamp than the
      index, we need to perform a full check of the contents, as the update of
      the file may have happened just after we wrote the index.
      
      The iterator changes are such that we can reach inside the workdir
      iterator from the diff, though it may be better to have an accessor
      instead of moving these structs into the header.
      Carlos Martín Nieto committed
  20. 20 Jun, 2015 1 commit
  21. 28 May, 2015 7 commits
  22. 04 May, 2015 1 commit
  23. 15 Apr, 2015 3 commits
  24. 12 Mar, 2015 1 commit
  25. 03 Mar, 2015 1 commit
    • config: borrow refcounted references · 9a97f49e
      This changes the get_entry() method to return a refcounted version of
      the config entry, which you have to free when you're done.
      
      This allows us to avoid freeing the memory in which the entry is stored
      on a refresh, which may happen at any time for a live config.
      
      For this reason, get_string() has been forbidden on live configs and a
      new function get_string_buf() has been added, which stores the string in
      a git_buf which the user then owns.
      
      The functions which parse the string value takea advantage of the
      borrowing to parse safely and then release the entry.
      Carlos Martín Nieto committed
  26. 19 Feb, 2015 1 commit
  27. 13 Feb, 2015 1 commit