1. 01 Feb, 2018 1 commit
    • attr: avoid stat'ting files for bare repositories · e28e17e6
      Depending on whether the path we want to look up an attribute for is a
      file or a directory, the fnmatch function will be called with different
      flags. Because of this, we have to first stat(3) the path to determine
      whether it is a file or directory in `git_attr_path__init`. This is
      wasteful though in bare repositories, where we can already be assured
      that the path will never exist at all due to there being no worktree. In
      this case, we will execute an unnecessary syscall, which might be
      noticeable on networked file systems.
      
      What happens right now is that we always pass the `GIT_DIR_FLAG_UNKOWN`
      flag to `git_attr_path__init`, which causes it to `stat` the file itself
      to determine its type. As it is calling `git_path_isdir` on the path,
      which will always return `false` in case the path does not exist, we end
      up with the path always being treated as a file in case of a bare
      repository. As such, we can just check the bare-repository case in all
      callers and then pass in `GIT_DIR_FLAG_FALSE` ourselves, avoiding the
      need to `stat`. While this may not always be correct, it at least is no
      different from our current behavior.
      Patrick Steinhardt committed
  2. 25 Jan, 2018 1 commit
  3. 22 Jan, 2018 1 commit
  4. 20 Jan, 2018 3 commits
  5. 19 Jan, 2018 3 commits
  6. 18 Jan, 2018 1 commit
  7. 17 Jan, 2018 7 commits
  8. 12 Jan, 2018 5 commits
  9. 11 Jan, 2018 1 commit
  10. 10 Jan, 2018 5 commits
  11. 08 Jan, 2018 3 commits
  12. 07 Jan, 2018 2 commits
  13. 05 Jan, 2018 2 commits
  14. 04 Jan, 2018 5 commits