1. 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
  2. 27 Nov, 2020 1 commit
  3. 11 Oct, 2020 1 commit
  4. 24 Jan, 2020 1 commit
  5. 09 Jan, 2020 1 commit
  6. 24 Jun, 2019 1 commit
    • netops: safely cast to int · f7597410
      Only read at most INT_MAX from the underlying stream, so that we can
      accurately return the number of bytes read.
      
      Since callers are not guaranteed to get as many bytes as requested (due
      to availability of input), this is safe and callers should call in a
      loop until EOF.
      Edward Thomson committed
  7. 10 Jun, 2019 1 commit
    • net: rename gitno_connection_data to git_net_url · c6ab183e
      "Connection data" is an imprecise and largely incorrect name; these
      structures are actually parsed URLs.  Provide a parser that takes a URL
      string and produces a URL structure (if it is valid).
      
      Separate the HTTP redirect handling logic from URL parsing, keeping a
      `gitno_connection_data_handle_redirect` whose only job is redirect
      handling logic and does not parse URLs itself.
      Edward Thomson committed
  8. 22 Jan, 2019 1 commit
  9. 09 Nov, 2018 1 commit
  10. 10 Jun, 2018 1 commit
  11. 19 Mar, 2018 4 commits
  12. 03 Jul, 2017 1 commit
    • Make sure to always include "common.h" first · 0c7f49dd
      Next to including several files, our "common.h" header also declares
      various macros which are then used throughout the project. As such, we
      have to make sure to always include this file first in all
      implementation files. Otherwise, we might encounter problems or even
      silent behavioural differences due to macros or defines not being
      defined as they should be. So in fact, our header and implementation
      files should make sure to always include "common.h" first.
      
      This commit does so by establishing a common include pattern. Header
      files inside of "src" will now always include "common.h" as its first
      other file, separated by a newline from all the other includes to make
      it stand out as special. There are two cases for the implementation
      files. If they do have a matching header file, they will always include
      this one first, leading to "common.h" being transitively included as
      first file. If they do not have a matching header file, they instead
      include "common.h" as first file themselves.
      
      This fixes the outlined problems and will become our standard practice
      for header and source files inside of the "src/" from now on.
      Patrick Steinhardt committed
  13. 29 Dec, 2016 1 commit
  14. 19 Apr, 2016 1 commit
  15. 18 Feb, 2016 1 commit
  16. 29 May, 2015 1 commit
    • git__tolower: a tolower() that isn't dumb · 75a4636f
      Some brain damaged tolower() implementations appear to want to
      take the locale into account, and this may require taking some
      insanely aggressive lock on the locale and slowing down what should
      be the most trivial of trivial calls for people who just want to
      downcase ASCII.
      Edward Thomson committed
  17. 10 Dec, 2014 2 commits
  18. 02 Nov, 2014 1 commit
  19. 24 Sep, 2014 1 commit
  20. 16 Sep, 2014 2 commits
    • net: remove support for outright ignoring certificates · 41698f22
      This option make it easy to ignore anything about the server we're
      connecting to, which is bad security practice. This was necessary as we
      didn't use to expose detailed information about the certificate, but now
      that we do, we should get rid of this.
      
      If the user wants to ignore everything, they can still provide a
      callback which ignores all the information passed.
      Carlos Martín Nieto committed
    • Provide a callback for certificate validation · 9b940586
      If the certificate validation fails (or always in the case of ssh),
      let the user decide whether to allow the connection.
      
      The data structure passed to the user is the native certificate
      information from the underlying implementation, namely OpenSSL or
      WinHTTP.
      Carlos Martín Nieto committed
  21. 06 Jul, 2014 1 commit
  22. 03 Jul, 2014 1 commit
  23. 12 Jun, 2014 2 commits
  24. 11 Jun, 2014 2 commits
  25. 13 May, 2014 1 commit
  26. 26 Apr, 2014 3 commits
  27. 18 Nov, 2013 1 commit
  28. 13 Nov, 2013 1 commit
  29. 12 Nov, 2013 1 commit
  30. 05 Nov, 2013 2 commits