1. 16 10月, 2011 2 次提交
  2. 07 10月, 2011 1 次提交
    • B
      cleanup: use internal memory allocation wrapper functions everywhere · 040a6551
      Brandon Casey 提交于
      The "x"-prefixed versions of strdup, malloc, etc. will check whether the
      allocation was successful and terminate the process otherwise.
      
      A few uses of malloc were left alone since they already implemented a
      graceful path of failure or were in a quasi external library like xdiff.
      
      Additionally, the call to malloc in compat/win32/syslog.c was not modified
      since the syslog() implemented there is a die handler and a call to the
      x-wrappers within a die handler could result in recursion should memory
      allocation fail.  This will have to be addressed separately.
      Signed-off-by: NBrandon Casey <drafnel@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      040a6551
  3. 06 10月, 2011 2 次提交
  4. 13 9月, 2011 1 次提交
  5. 08 6月, 2011 1 次提交
  6. 06 6月, 2011 1 次提交
    • J
      consider only branches in guess_remote_head · 61adfd30
      Jeff King 提交于
      The guess_remote_head function tries to figure out where a
      remote's HEAD is pointing by comparing the sha1 of the
      remote's HEAD with the sha1 of various refs found on the
      remote. However, we were too liberal in matching refs, and
      would match tags or remote tracking branches, even though
      these things could not possibly be referenced by the HEAD
      symbolic ref (since git will detach when checking them out).
      
      As a result, a clone of a remote repository with a detached
      HEAD might write "refs/tags/*" into our local HEAD, which is
      bogus. The resulting HEAD should be detached.
      
      The other related code path is remote.c's get_head_names()
      (which is used for, among other things, "set-head -a"). This was
      not affected, however, as that function feeds only refs from
      refs/heads to guess_remote_head.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      61adfd30
  7. 04 11月, 2010 1 次提交
  8. 06 7月, 2010 1 次提交
  9. 28 6月, 2010 3 次提交
  10. 08 6月, 2010 1 次提交
  11. 01 6月, 2010 1 次提交
    • G
      Rewrite dynamic structure initializations to runtime assignment · 66dbfd55
      Gary V. Vaughan 提交于
      Unfortunately, there are still plenty of production systems with
      vendor compilers that choke unless all compound declarations can be
      determined statically at compile time, for example hpux10.20 (I can
      provide a comprehensive list of our supported platforms that exhibit
      this problem if necessary).
      
      This patch simply breaks apart any compound declarations with dynamic
      initialisation expressions, and moves the initialisation until after
      the last declaration in the same block, in all the places necessary to
      have the offending compilers accept the code.
      Signed-off-by: NGary V. Vaughan <gary@thewrittenword.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      66dbfd55
  12. 20 4月, 2010 1 次提交
  13. 10 1月, 2010 1 次提交
    • T
      refactor ref status logic for pushing · 20e8b465
      Tay Ray Chuan 提交于
      Move the logic that detects up-to-date and non-fast-forward refs to a
      new function in remote.[ch], set_ref_status_for_push().
      
      Make transport_push() invoke set_ref_status_for_push() before invoking
      the push_refs() implementation. (As a side-effect, the push_refs()
      implementation in transport-helper.c now knows of non-fast-forward
      pushes.)
      
      Removed logic for detecting up-to-date refs from the push_refs()
      implementation in transport-helper.c, as transport_push() has already
      done so for it.
      
      Make cmd_send_pack() invoke set_ref_status_for_push() before invoking
      send_pack(), as transport_push() can't do it for send_pack() here.
      
      Mark the test on the return status of non-fast-forward push to fail.
      Git now exits with success, as transport.c::transport_push() does not
      check for refs with status REF_STATUS_REJECT_NONFASTFORWARD nor does it
      indicate rejected pushes with its return value.
      
      Mark the test for ref status to succeed. As mentioned earlier, refs
      might be marked as non-fast-forwards, triggering the push status
      printing mechanism in transport.c.
      Signed-off-by: NTay Ray Chuan <rctay89@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      20e8b465
  14. 18 11月, 2009 3 次提交
  15. 15 11月, 2009 1 次提交
  16. 10 11月, 2009 2 次提交
  17. 28 10月, 2009 1 次提交
  18. 08 9月, 2009 2 次提交
  19. 01 9月, 2009 1 次提交
  20. 21 6月, 2009 1 次提交
    • L
      Fix various sparse warnings in the git source code · 2af202be
      Linus Torvalds 提交于
      There are a few remaining ones, but this fixes the trivial ones. It boils
      down to two main issues that sparse complains about:
      
       - warning: Using plain integer as NULL pointer
      
         Sparse doesn't like you using '0' instead of 'NULL'. For various good
         reasons, not the least of which is just the visual confusion. A NULL
         pointer is not an integer, and that whole "0 works as NULL" is a
         historical accident and not very pretty.
      
         A few of these remain: zlib is a total mess, and Z_NULL is just a 0.
         I didn't touch those.
      
       - warning: symbol 'xyz' was not declared. Should it be static?
      
         Sparse wants to see declarations for any functions you export. A lack
         of a declaration tends to mean that you should either add one, or you
         should mark the function 'static' to show that it's in file scope.
      
         A few of these remain: I only did the ones that should obviously just
         be made static.
      
      That 'wt_status_submodule_summary' one is debatable. It has a few related
      flags (like 'wt_status_use_color') which _are_ declared, and are used by
      builtin-commit.c. So maybe we'd like to export it at some point, but it's
      not declared now, and not used outside of that file, so 'static' it is in
      this patch.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2af202be
  21. 19 6月, 2009 1 次提交
  22. 10 6月, 2009 1 次提交
  23. 02 6月, 2009 1 次提交
  24. 15 5月, 2009 1 次提交
    • M
      Fix behavior with non-commit upstream references · 57ffc5f8
      Michael J Gruber 提交于
      stat_tracking_info() assumes that upstream references (as specified by
      --track or set up automatically) are commits. By calling lookup_commit()
      on them, create_objects() creates objects for them with type commit no
      matter what their real type is; this disturbs lookup_tag() later on in the
      call sequence, leading to git status, git branch -v  and git checkout
      erroring out.
      
      Fix this by using lookup_commit_reference() instead so that (annotated)
      tags can be used as upstream references.
      Signed-off-by: NMichael J Gruber <git@drmicha.warpmail.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      57ffc5f8
  25. 24 4月, 2009 1 次提交
  26. 22 4月, 2009 1 次提交
  27. 18 4月, 2009 2 次提交
  28. 08 4月, 2009 1 次提交
  29. 02 4月, 2009 1 次提交
    • M
      Make local branches behave like remote branches when --tracked · 5e6e2b48
      Michael J Gruber 提交于
      This makes sure that local branches, when followed using --track, behave
      the same as remote ones (e.g. differences being reported by git status
      and git checkout). This fixes 1 known failure.
      
      The fix is done within branch_get(): The first natural candidate,
      namely remote_find_tracking(), does not have all the necessary info
      because in general there is no remote struct for '.', and we don't want
      one because it would show up in other places as well.
      
      branch_get(), on the other hand, has access to merge_names[] (in
      addition to merge[]) and therefore can set up the followed branch
      easily.
      Signed-off-by: NMichael J Gruber <git@drmicha.warpmail.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      5e6e2b48
  30. 16 3月, 2009 1 次提交
    • J
      Remove total confusion from git-fetch and git-push · 9326d494
      Junio C Hamano 提交于
      The config file is not the only place remotes are defined, and without
      consulting .git/remotes and .git/branches, you won't know if "origin" is
      configured by the user.  Don't give up too early and insult the user with
      a wisecrack "Where do you want to fetch from today?"
      
      The only thing the previous patch seems to want to prevent from happening
      is a lazy "git fetch/push" that does not say where-from/to to produce an
      error message 'origin not found', and we can do that by not letting
      add_url_alias() to turn a nickname "origin" literally into a pathname
      "origin" without changing the rest of the logic.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9326d494
  31. 15 3月, 2009 1 次提交
    • B
      Remove unused assignments · 8e76bf3f
      Benjamin Kramer 提交于
      These variables were always overwritten or the assigned
      value was unused:
      
        builtin-diff-tree.c::cmd_diff_tree(): nr_sha1
        builtin-for-each-ref.c::opt_parse_sort(): sort_tail
        builtin-mailinfo.c::decode_header_bq(): in
        builtin-shortlog.c::insert_one_record(): len
        connect.c::git_connect(): path
        imap-send.c::v_issue_imap_cmd(): n
        pretty.c::pp_user_info(): filler
        remote::parse_refspec_internal(): llen
      Signed-off-by: NBenjamin Kramer <benny.kra@googlemail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8e76bf3f