1. 09 Feb, 2011 1 commit
    • Use the new git__joinpath to build paths in methods · 995f9c34
      The `git__joinpath` function has been changed to use a statically
      allocated buffer; we assume the buffer to be 4096 bytes, because fuck
      you.
      
      The new method also supports an arbritrary number of paths to join,
      which may come in handy in the future.
      
      Some methods which were manually joining paths with `strcpy` now use the
      new function, namely those in `index.c` and `refs.c`.
      
      Based on Emeric Fermas' original patch, which was using the old
      `git__joinpath` because I'm stupid. Thanks!
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
  2. 05 Feb, 2011 3 commits
  3. 29 Dec, 2010 1 commit
    • Add generic hash function to util.c · e0646b38
      It's MurmurHash3 slightly edited to make it
      cross-platform. Fast and neat.
      
      Use this for hashing strings on hash tables instead
      of a full SHA1 hash. It's very fast and well distributed.
      
      Obviously not crypto-secure.
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
  4. 22 Dec, 2010 1 commit
    • Remove git_errno · 9f54fe48
      It was not being used by any methods (only by malloc and calloc), and
      since it needs to be TLS, it cannot be exported on DLLs on Windows.
      
      Burn it with fire. The API always returns error codes!
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
  5. 19 Nov, 2010 1 commit
  6. 12 Aug, 2010 1 commit
  7. 20 Jan, 2010 1 commit
  8. 05 Jun, 2009 1 commit
  9. 18 Mar, 2009 1 commit
    • Fix some (digital-mars) compiler warnings · a9984a4e
      In particular, conditional expressions which contain an
      assignment statement, where the expression type is not
      explicitly made to be boolean, elicits the following
      message:
          warning 2: possible unintended assignment
      
      Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Ramsay Jones committed
  10. 28 Jan, 2009 1 commit
    • Add git__dirname and git__basename utility routines · ced645ea
      These routines are intended to extract the directory and
      base name from a path string. Note that these routines
      do not interact with any filesystem and work only on the
      text of the path.
      
      Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Ramsay Jones committed
  11. 01 Jan, 2009 1 commit
  12. 31 Dec, 2008 2 commits
    • Add string utility functions for prefix and suffix compares · 9eb79764
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Shawn O. Pearce committed
    • Wrap malloc and friends and report out of memory as GIT_ENOMEM · 64a47c01
      We now forbid direct use of malloc, strdup or calloc within the
      library and instead use wrapper functions git__malloc, etc. to
      invoke the underlying library malloc and set git_errno to a no
      memory error code if the allocation fails.
      
      In the future once we have pack objects in memory we are likely
      to enhance these routines with garbage collection logic to purge
      cached pack data when allocations fail.  Because the size of the
      function will grow somewhat large, we don't want to mark them for
      inline as gcc tends to aggressively inline, creating larger than
      expected executables.
      
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Shawn O. Pearce committed