1. 13 Aug, 2014 1 commit
  2. 08 Aug, 2014 2 commits
    • Demonstrate a trailing slash failure. · bbe13802
      `git help ignore` has this to say about trailing slashes:
      
      > If the pattern ends with a slash, it is removed for the purpose of
      > the following description, but it would only find a match with a
      > directory. In other words, foo/ will match a directory foo and
      > paths underneath it, but will not match a regular file or a
      > symbolic link foo (this is consistent with the way how pathspec
      > works in general in Git).
      
      Sure enough, having manually performed the same steps as this test,
      `git status` tells us the following:
      
      	# On branch master
      	#
      	# Initial commit
      	#
      	# Changes to be committed:
      	#   (use "git rm --cached <file>..." to unstage)
      	#
      	#	new file:   force.txt
      	#
      	# Untracked files:
      	#   (use "git add <file>..." to include in what will be committed)
      	#
      	#	../.gitignore
      	#	child1/
      	#	child2/
      
      i.e. neither child1 nor child2 is ignored.
      Rob Rix committed
    • status: failing test with slash-star · aa5cdf63
      When writing 'bin/*' in the rules, this means we ignore very file inside
      bin/ individually, but do not ignore the directory itself. Thus the
      status listing should list both files under bin/, one untracked and one
      ignored.
      Carlos Martín Nieto committed
  3. 01 Jul, 2014 1 commit
  4. 04 Jun, 2014 2 commits
  5. 30 May, 2014 2 commits
  6. 22 May, 2014 2 commits
  7. 21 May, 2014 1 commit
  8. 15 May, 2014 2 commits
  9. 14 May, 2014 1 commit
  10. 06 May, 2014 1 commit
    • Improve checks for ignore containment · f554611a
      The diff code was using an "ignored_prefix" directory to track if
      a parent directory was ignored that contained untracked files
      alongside tracked files. Unfortunately, when negative ignore rules
      were used for directories inside ignored parents, the wrong rules
      were applied to untracked files inside the negatively ignored
      child directories.
      
      This commit moves the logic for ignore containment into the workdir
      iterator (which is a better place for it), so the ignored-ness of
      a directory is contained in the frame stack during traversal.  This
      allows a child directory to override with a negative ignore and yet
      still restore the ignored state of the parent when we traverse out
      of the child.
      
      Along with this, there are some problems with "directory only"
      ignore rules on container directories.  Given "a/*" and "!a/b/c/"
      (where the second rule is a directory rule but the first rule is
      just a generic prefix rule), then the directory only constraint
      was having "a/b/c/d/file" match the first rule and not the second.
      This was fixed by having ignore directory-only rules test a rule
      against the prefix of a file with LEADINGDIR enabled.
      
      Lastly, spot checks for ignores using `git_ignore_path_is_ignored`
      were tested from the top directory down to the bottom to deal with
      the containment problem, but this is wrong. We have to test bottom
      to top so that negative subdirectory rules will be checked before
      parent ignore rules.
      
      This does change the behavior of some existing tests, but it seems
      only to bring us more in line with core Git, so I think those
      changes are acceptable.
      Russell Belfer committed
  11. 02 May, 2014 6 commits
  12. 24 Apr, 2014 3 commits
  13. 18 Apr, 2014 3 commits
  14. 17 Apr, 2014 1 commit
  15. 14 Apr, 2014 1 commit
    • Fix core.excludesfile named .gitignore · a9528b8f
      Ignore rules with slashes in them are matched using FNM_PATHNAME
      and use the path to the .gitignore file from the root of the
      repository along with the path fragment (including slashes) in
      the ignore file itself.  Unfortunately, the relative path to the
      .gitignore file was being applied to the global core.excludesfile
      if that was also named ".gitignore".
      
      This fixes that with more precise matching and includes test for
      ignore rules with leading slashes (which were the primary example
      of this being broken in the real world).
      
      This also backports an improvement to the file context logic from
      the threadsafe-iterators branch where we don't rely on mutating
      the key of the attribute file name to generate the context path.
      Russell Belfer committed
  16. 10 Apr, 2014 1 commit
    • Fix bug popping ignore files during wd iteration · 8f7bc646
      There were a couple bugs in popping ignore files during iteration
      that could result in incorrect decisions be made and thus ignore
      files below the root either not being loaded correctly or not
      being popped at the right time.
      
      One bug was an off-by-one in comparing the path of the gitignore
      file with the path being exited during iteration.
      
      The second bug was not correctly truncating the path being tracked
      during traversal if there were no ignores on the list (i.e. when
      you have no .gitignore at the root, but do have some in contained
      directories).
      Russell Belfer committed
  17. 08 Apr, 2014 1 commit
    • Update submodules with parent-tracked content · eb7e17cc
      This updates how libgit2 treats submodule-like directories that
      actually have tracked content inside of them.  This is a strange
      corner case, but it seems that many people have abortive submodule
      setups and then just went ahead and added the files into the
      parent repository.  In this case, we should just treat the
      submodule as if it was a normal directory.
      
      Libgit2 will still try to skip over real submodules and contained
      repositories that do not have tracked files inside them, but this
      adds some new handling for cases where the apparently submodule
      data is in conflict with the actual list of tracked files.
      Russell Belfer committed
  18. 02 Apr, 2014 1 commit
  19. 25 Mar, 2014 1 commit
    • Make submodules externally refcounted · a15c7802
      `git_submodule` objects were already refcounted internally in case
      the submodule name was different from the path at which it was
      stored.  This makes that refcounting externally used as well, so
      `git_submodule_lookup` and `git_submodule_add_setup` return an
      object that requires a `git_submodule_free` when done.
      Russell Belfer committed
  20. 30 Jan, 2014 2 commits
  21. 25 Jan, 2014 1 commit
  22. 22 Jan, 2014 1 commit
  23. 20 Jan, 2014 1 commit
  24. 11 Dec, 2013 1 commit
    • Remove converting user error to GIT_EUSER · 25e0b157
      This changes the behavior of callbacks so that the callback error
      code is not converted into GIT_EUSER and instead we propagate the
      return value through to the caller.  Instead of using the
      giterr_capture and giterr_restore functions, we now rely on all
      functions to pass back the return value from a callback.
      
      To avoid having a return value with no error message, the user
      can call the public giterr_set_str or some such function to set
      an error message.  There is a new helper 'giterr_set_callback'
      that functions can invoke after making a callback which ensures
      that some error message was set in case the callback did not set
      one.
      
      In places where the sign of the callback return value is
      meaningful (e.g. positive to skip, negative to abort), only the
      negative values are returned back to the caller, obviously, since
      the other values allow for continuing the loop.
      
      The hardest parts of this were in the checkout code where positive
      return values were overloaded as meaningful values for checkout.
      I fixed this by adding an output parameter to many of the internal
      checkout functions and removing the overload.  This added some
      code, but it is probably a better implementation.
      
      There is some funkiness in the network code where user provided
      callbacks could be returning a positive or a negative value and
      we want to rely on that to cancel the loop.  There are still a
      couple places where an user error might get turned into GIT_EUSER
      there, I think, though none exercised by the tests.
      Russell Belfer committed
  25. 14 Nov, 2013 1 commit