1. 07 Nov, 2011 2 commits
  2. 05 Nov, 2011 1 commit
  3. 29 Oct, 2011 6 commits
  4. 28 Oct, 2011 2 commits
  5. 27 Oct, 2011 8 commits
  6. 24 Oct, 2011 3 commits
    • tests-clay: move t01-rawobj.c to clay · 9ff46db9
      Signed-off-by: schu <schu-github@schulog.org>
      schu committed
    • Merge pull request #464 from rtyley/development · c2fbe423
      Tolerate zlib deflation with window size < 32Kb
      Vicent Martí committed
    • Tolerate zlib deflation with window size < 32Kb · c51065e3
      libgit2 currently identifies loose objects as corrupt if they've been
      deflated using a window size less than 32Kb, because the
      is_zlib_compressed_data() function doesn't recognise the header
      byte as a zlib header. This patch makes the method tolerant of
      all valid window sizes (15-bit to 8-bit) - but doesn't sacrifice
      it's accuracy in distingushing the standard loose-object format
      from the experimental (now abandoned) format. It's based on a patch
      which has been merged into C-Git master branch:
      
      https://github.com/git/git/commit/7f684a2aff636f44a506
      
      On memory constrained systems zlib may use a much smaller window
      size - working on Agit, I found that Android uses a 4KB window;
      giving a header byte of 0x48, not 0x78. Consequently all loose
      objects generated by the Android platform appear 'corrupt' :(
      
      It might appear that this patch changes isStandardFormat() to the
      point where it could incorrectly identify the experimental format as
      the standard one, but the two criteria (bitmask & checksum) can only
      give a false result for an experimental object where both of the
      following are true:
      
      1) object size is exactly 8 bytes when uncompressed (bitmask)
      2) [single-byte in-pack git type&size header] * 256
         + [1st byte of the following zlib header] % 31 = 0 (checksum)
      
      As it happens, for all possible combinations of valid object type
      (1-4) and window bits (0-7), the only time when the checksum will be
      divisible by 31 is for 0x1838 - ie object type *1*, a Commit - which,
      due the fields all Commit objects must contain, could never be as
      small as 8 bytes in size.
      
      Given this, the combination of the two criteria (bitmask & checksum)
      always correctly determines the buffer format, and is more tolerant
      than the previous version.
      
      References:
      
      Android uses a 4KB window for deflation:
      http://android.git.kernel.org/?p=platform/libcore.git;a=blob;f=luni/src/main/native/java_util_zip_Deflater.cpp;h=c0b2feff196e63a7b85d97cf9ae5bb258
      
      Code snippet searching for false positives with the zlib checksum:
      https://gist.github.com/1118177
      
      Change-Id: Ifd84cd2bd6b46f087c9984fb4cbd8309f483dec0
      Roberto Tyley committed
  7. 22 Oct, 2011 1 commit
  8. 20 Oct, 2011 1 commit
  9. 18 Oct, 2011 1 commit
  10. 15 Oct, 2011 1 commit
    • mwindow: close LRU window properly · 5fa1bed0
      Remove a wrong call to git_mwindow_close which caused a segfault if it
      ever did run. In that same piece of code, if the LRU was from the
      first wiindow in the list in a different file, we didn't update that
      list, so the first element had been freed.
      
      Fix these two issues.
      
      Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
      Carlos Martín Nieto committed
  11. 14 Oct, 2011 8 commits
    • Merge pull request #459 from brodie/test-improvements · a014a083
      tests: propagate errors from open_temp_repo() instead of exiting
      Vicent Martí committed
    • tests: propagate errors from open_temp_repo() instead of exiting · 252840a5
      This makes it slightly easier to debug test failures when one test
      opens a repo, has a failure, and doesn't get a chance to close it for
      the next test. Now, instead of getting no feedback, we at least see
      test failure information.
      Brodie Rao committed
    • *: correct and codify various file permissions · 01ad7b3a
      The following files now have 0444 permissions:
      
      - loose objects
      - pack indexes
      - pack files
      - packs downloaded by fetch
      - packs downloaded by the HTTP transport
      
      And the following files now have 0666 permissions:
      
      - config files
      - repository indexes
      - reflogs
      - refs
      
      This brings libgit2 more in line with Git.
      
      Note that git_filebuf_commit() and git_filebuf_commit_at() have both
      gained a new mode parameter.
      
      The latter change fixes an important issue where filebufs created with
      GIT_FILEBUF_TEMPORARY received 0600 permissions (due to mkstemp(3)
      usage). Now we chmod() the file before renaming it into place.
      
      Tests have been added to confirm that new commit, tag, and tree
      objects are created with the right permissions. I don't have access to
      Windows, so for now I've guarded the tests with "#ifndef GIT_WIN32".
      Brodie Rao committed
    • fileops/repository: create (most) directories with 0777 permissions · ce8cd006
      To further match how Git behaves, this change makes most of the
      directories libgit2 creates in a git repo have a file mode of
      0777. Specifically:
      
      - Intermediate directories created with git_futils_mkpath2file() have
        0777 permissions. This affects odb_loose, reflog, and refs.
      
      - The top level folder for bare repos is created with 0777
        permissions.
      
      - The top level folder for non-bare repos is created with 0755
        permissions.
      
      - /objects/info/, /objects/pack/, /refs/heads/, and /refs/tags/ are
        created with 0777 permissions.
      
      Additionally, the following changes have been made:
      
      - fileops functions that create intermediate directories have grown a
        new dirmode parameter. The only exception to this is filebuf's
        lock_file(), which unconditionally creates intermediate directories
        with 0777 permissions when GIT_FILEBUF_FORCE is set.
      
      - The test runner now sets the umask to 0 before running any
        tests. This ensurses all file mode checks are consistent across
        systems.
      
      - t09-tree.c now does a directory permissions check. I've avoided
        adding this check to other tests that might reuse existing
        directories from the prefabricated test repos. Because they're
        checked into the repo, they have 0755 permissions.
      
      - Other assorted directories created by tests have 0777 permissions.
      Brodie Rao committed
    • fileops/posix: replace usage of "int mode" with "mode_t mode" · 33127043
      Note: Functions exported from fileops take const mode_t, while the
      underlying POSIX wrappers take mode_t.
      Brodie Rao committed
    • Merge pull request #457 from khalsah/makefile-fix · 1776f5ab
      Update Makefile.embed with http-parser dependency
      Vicent Martí committed
  12. 13 Oct, 2011 6 commits