1. 26 5月, 2008 1 次提交
  2. 12 5月, 2008 1 次提交
  3. 27 4月, 2008 1 次提交
    • D
      Make walker.fetch_ref() take a struct ref. · c13b2633
      Daniel Barkalow 提交于
      This simplifies a few things, makes a few things slightly more
      complicated, but, more importantly, allows that, when struct ref can
      represent a symref, http_fetch_ref() can return one.
      
      Incidentally makes the string that http_fetch_ref() gets include "refs/"
      (if appropriate), because that's how the name field of struct ref works.
      As far as I can tell, the usage in walker:interpret_target() wouldn't have
      worked previously, if it ever would have been used, which it wouldn't
      (since the fetch process uses the hash instead of the name of the ref
      there).
      Signed-off-by: NDaniel Barkalow <barkalow@iabervon.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c13b2633
  4. 28 2月, 2008 2 次提交
  5. 23 2月, 2008 1 次提交
    • J
      Avoid unnecessary "if-before-free" tests. · 8e0f7003
      Jim Meyering 提交于
      This change removes all obvious useless if-before-free tests.
      E.g., it replaces code like this:
      
              if (some_expression)
                      free (some_expression);
      
      with the now-equivalent:
      
              free (some_expression);
      
      It is equivalent not just because POSIX has required free(NULL)
      to work for a long time, but simply because it has worked for
      so long that no reasonable porting target fails the test.
      Here's some evidence from nearly 1.5 years ago:
      
          http://www.winehq.org/pipermail/wine-patches/2006-October/031544.html
      
      FYI, the change below was prepared by running the following:
      
        git ls-files -z | xargs -0 \
        perl -0x3b -pi -e \
          's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*NULL)?\s*\)\s+(free\s*\(\s*\1\s*\))/$2/s'
      
      Note however, that it doesn't handle brace-enclosed blocks like
      "if (x) { free (x); }".  But that's ok, since there were none like
      that in git sources.
      
      Beware: if you do use the above snippet, note that it can
      produce syntactically invalid C code.  That happens when the
      affected "if"-statement has a matching "else".
      E.g., it would transform this
      
        if (x)
          free (x);
        else
          foo ();
      
      into this:
      
        free (x);
        else
          foo ();
      
      There were none of those here, either.
      
      If you're interested in automating detection of the useless
      tests, you might like the useless-if-before-free script in gnulib:
      [it *does* detect brace-enclosed free statements, and has a --name=S
       option to make it detect free-like functions with different names]
      
        http://git.sv.gnu.org/gitweb/?p=gnulib.git;a=blob;f=build-aux/useless-if-before-free
      
      Addendum:
        Remove one more (in imap-send.c), spotted by Jean-Luc Herren <jlh@gmx.ch>.
      Signed-off-by: NJim Meyering <meyering@redhat.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8e0f7003
  6. 18 2月, 2008 1 次提交
  7. 16 2月, 2008 3 次提交
  8. 21 1月, 2008 4 次提交
    • G
      http-push and http-fetch: handle URLs without trailing / · 3057ded0
      Grégoire Barbier 提交于
      The URL to a repository http-push and http-fetch takes should
      have a trailing slash.  Instead of failing the request, add it
      ourselves before attempting such a request.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      3057ded0
    • J
      http-push: clarify the reason of error from the initial PROPFIND request · 325ce395
      Junio C Hamano 提交于
      The first thing http-push does is a PROPFIND to see if the other
      end supports locking.  The failure message we give is always
      reported as "no DAV locking support at the remote repository",
      regardless of the reason why we ended up not finding the locking
      support on the other end.
      
      This moves the code to report "no DAV locking support" down the
      codepath so that the message is issued only when we successfully
      get a response to PROPFIND and the other end say it does not
      support locking.  Other failures, such as connectivity glitches
      and credential mismatches, have their own error message issued
      and we will not issue "no DAV locking" error (we do not even
      know if the remote end supports it).
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      325ce395
    • G
      http-push: fail when info/refs exists and is already locked · 9bdbabad
      Grégoire Barbier 提交于
      Failing instead of silently not updating remote refs makes the things
      clearer for the user when trying to push on a repository while another
      person do (or while a dandling locks are waiting for a 10 minutes
      timeout).
      
      When silently not updating remote refs, the user does not even know
      that git has pushed the objects but leaved the refs as they were
      before (e.g. a new bunch of commits on branch "master" is uploaded,
      however the branch by itsel still points on the previous head commit).
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9bdbabad
    • G
      http-push: fix webdav lock leak. · 9116de59
      Grégoire Barbier 提交于
      Releasing webdav lock even if push fails because of bad (or no)
      reference on command line.
      
      To reproduce the issue that this patch fixes, prepare a test repository
      availlable over http+webdav, say at http://myhost/myrepo.git/
      
      Then:
      
        $ git clone http://myhost/myrepo.git/
        $ cd myrepo
        $ git push http
        Fetching remote heads...
          refs/
          refs/heads/
          refs/tags/
        No refs in common and none specified; doing nothing.
        $ git push http
        Fetching remote heads...
          refs/
          refs/heads/
          refs/tags/
        No refs in common and none specified; doing nothing.
        $
      
      Finally, you look at the web server logs, and will find one LOCK query
      and no UNLOCK query, of course the second one will be in 423 return
      code instead of 200:
      
      1.2.3.4 - gb [19/Jan/2008:14:24:56 +0100] "LOCK /myrepo.git/info/refs HTTP/1.1" 200 465
      (...)
      1.2.3.4 - gb [19/Jan/2008:14:25:10 +0100] "LOCK /myrepo.git/info/refs HTTP/1.1" 423 363
      
      With this patch, there would have be two UNLOCKs in addition of the LOCKs
      
      From the user's point of view:
      
      - If you realize that you should have typed e.g. "git push http
        master" instead of "git push http", you will have to wait for 10
        minutes for the lock to expire by its own.
      
      - Furthermore, if somebody else is dumb enough to type "git push http"
        while you need to push "master" branch, then you'll need too to wait
        for 10 minutes too.
      Signed-off-by: NGr.ANigoire Barbier <gb@gbarbier.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9116de59
  9. 19 1月, 2008 1 次提交
  10. 31 12月, 2007 1 次提交
  11. 15 12月, 2007 6 次提交
  12. 13 12月, 2007 1 次提交
  13. 26 11月, 2007 1 次提交
  14. 10 11月, 2007 1 次提交
    • A
      Teach send-pack a mirror mode · 28b9d6e5
      Andy Whitcroft 提交于
      Existing "git push --all" is almost perfect for backing up to
      another repository, except that "--all" only means "all
      branches" in modern git, and it does not delete old branches and
      tags that exist at the back-up repository that you have removed
      from your local repository.
      
      This teaches "git-send-pack" a new "--mirror" option.  The
      difference from the "--all" option are that (1) it sends all
      refs, not just branches, and (2) it deletes old refs you no
      longer have on the local side from the remote side.
      
      Original patch by Junio C Hamano.
      Signed-off-by: NAndy Whitcroft <apw@shadowen.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      28b9d6e5
  15. 04 11月, 2007 1 次提交
  16. 03 11月, 2007 1 次提交
    • D
      Miscellaneous const changes and utilities · 4577370e
      Daniel Barkalow 提交于
      The list of remote refs in struct transport should be const, because
      builtin-fetch will get confused if it changes.
      
      The url in git_connect should be const (and work on a copy) instead of
      requiring the caller to copy it.
      
      match_refs doesn't modify the refspecs it gets.
      
      get_fetch_map and get_remote_ref don't change the list they get.
      
      Allow transport get_refs_list methods to modify the struct transport.
      
      Add a function to copy a list of refs, when a function needs a mutable
      copy of a const list.
      
      Add a function to check the type of a ref, as per the code in connect.c
      Signed-off-by: NDaniel Barkalow <barkalow@iabervon.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4577370e
  17. 16 10月, 2007 1 次提交
  18. 19 9月, 2007 4 次提交
  19. 07 6月, 2007 1 次提交
    • J
      War on whitespace · a6080a0a
      Junio C Hamano 提交于
      This uses "git-apply --whitespace=strip" to fix whitespace errors that have
      crept in to our source files over time.  There are a few files that need
      to have trailing whitespaces (most notably, test vectors).  The results
      still passes the test, and build result in Documentation/ area is unchanged.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      a6080a0a
  20. 21 5月, 2007 1 次提交
  21. 06 4月, 2007 1 次提交
  22. 22 3月, 2007 1 次提交
  23. 02 3月, 2007 1 次提交
  24. 01 3月, 2007 1 次提交
  25. 27 2月, 2007 1 次提交
    • N
      convert object type handling from a string to a number · 21666f1a
      Nicolas Pitre 提交于
      We currently have two parallel notation for dealing with object types
      in the code: a string and a numerical value.  One of them is obviously
      redundent, and the most used one requires more stack space and a bunch
      of strcmp() all over the place.
      
      This is an initial step for the removal of the version using a char array
      found in object reading code paths.  The patch is unfortunately large but
      there is no sane way to split it in smaller parts without breaking the
      system.
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      21666f1a
  26. 21 2月, 2007 1 次提交