1. 08 2月, 2009 4 次提交
    • J
      Test and fix normalize_path_copy() · f42302b4
      Johannes Sixt 提交于
      This changes the test-path-utils utility to invoke normalize_path_copy()
      instead of normalize_absolute_path() because the latter is about to be
      removed.
      
      The test cases in t0060 are adjusted in two regards:
      
      - normalize_path_copy() more often leaves a trailing slash in the result.
        This has no negative side effects because the new user of this function,
        longest_ancester_length(), already accounts for this behavior.
      
      - The function can fail.
      
      The tests uncover a flaw in normalize_path_copy(): If there are
      sufficiently many '..' path components so that the root is reached, such as
      in "/d1/s1/../../d2", then the leading slash was lost. This manifested
      itself that (assuming there is a repository at /tmp/foo)
      
        $ git add /d1/../tmp/foo/some-file
      
      reported 'pathspec is outside repository'. This is now fixed.
      
      Moreover, the test case descriptions of t0060 now include the test data and
      expected outcome.
      Signed-off-by: NJohannes Sixt <j6t@kdbg.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      f42302b4
    • R
      Fix GIT_CEILING_DIRECTORIES on Windows · 43a7ddb5
      René Scharfe 提交于
      Using git with GIT_CEILING_DIRECTORIES crashed on Windows due to a failed
      assertion in normalize_absolute_path(): This function expects absolute
      paths to start with a slash, while on Windows they can start with a drive
      letter or a backslash.
      
      This fixes it by using the alternative, normalize_path_copy() instead,
      which can handle Windows-style paths just fine.
      
      Secondly, the portability macro PATH_SEP is used instead of expecting
      colons to be used as path list delimiter.
      
      The test script t1504 is also changed to help MSYS's bash recognize some
      program arguments as path list. (MSYS's bash must translate POSIX-style
      path lists to Windows-style path lists, and the heuristic did not catch
      some cases.)
      Signed-off-by: NRene Scharfe <rene.scharfe@lsrfire.ath.cx>
      Signed-off-by: NJohannes Sixt <j6t@kdbg.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      43a7ddb5
    • J
      Move sanitary_path_copy() to path.c and rename it to normalize_path_copy() · f3cad0ad
      Johannes Sixt 提交于
      This function and normalize_absolute_path() do almost the same thing. The
      former already works on Windows, but the latter crashes.
      
      In subsequent changes we will remove normalize_absolute_path(). Here we
      make the replacement function reusable. On the way we rename it to reflect
      that it does some path normalization. Apart from that this is only moving
      around code.
      Signed-off-by: NJohannes Sixt <j6t@kdbg.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      f3cad0ad
    • J
      Make test-path-utils more robust against incorrect use · 2cd85c40
      Johannes Sixt 提交于
      Previously, this test utility happily returned with exit code 0 if garbage
      was thrown at it. Now it reports failure if an unknown function name was
      given on the command line.
      Signed-off-by: NJohannes Sixt <j6t@kdbg.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2cd85c40
  2. 05 2月, 2009 4 次提交
  3. 04 2月, 2009 4 次提交
  4. 03 2月, 2009 1 次提交
  5. 01 2月, 2009 1 次提交
    • R
      merge: fix out-of-bounds memory access · c7cddc1a
      René Scharfe 提交于
      The parameter n of unpack_callback() can have a value of up to
      MAX_UNPACK_TREES.  The check at the top of unpack_trees() (its only
      (indirect) caller) makes sure it cannot exceed this limit.
      
      unpack_callback() passes it and the array src to unpack_nondirectories(),
      which has this loop:
      
      	for (i = 0; i < n; i++) {
      		/* ... */
      		src[i + o->merge] = o->df_conflict_entry;
      
      o->merge can be 0 or 1, so unpack_nondirectories() potentially accesses
      the array src at index MAX_UNPACK_TREES.  This patch makes it big enough.
      Reported-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NRené Scharfe <rene.scharfe@lsrfire.ath.cx>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c7cddc1a
  6. 29 1月, 2009 1 次提交
  7. 28 1月, 2009 2 次提交
  8. 23 1月, 2009 1 次提交
  9. 18 1月, 2009 4 次提交
  10. 16 1月, 2009 3 次提交
  11. 15 1月, 2009 2 次提交
  12. 14 1月, 2009 2 次提交
  13. 13 1月, 2009 2 次提交
  14. 07 1月, 2009 2 次提交
  15. 22 12月, 2008 1 次提交
  16. 20 12月, 2008 6 次提交