1. 22 Feb, 2019 2 commits
  2. 22 Jan, 2019 1 commit
  3. 17 Jan, 2019 1 commit
  4. 03 Oct, 2018 1 commit
  5. 06 Jul, 2018 1 commit
  6. 29 Jun, 2018 2 commits
  7. 26 Jun, 2018 1 commit
  8. 25 Jun, 2018 3 commits
  9. 24 Jun, 2018 1 commit
  10. 10 Jun, 2018 1 commit
  11. 11 Apr, 2018 4 commits
  12. 09 Oct, 2017 1 commit
    • transports: smart: fix memory leak when skipping symbolic refs · 7cb705cb
      When we setup the revision walk for negotiating references with a
      remote, we iterate over all references, ignoring tags and symbolic
      references. While skipping over symbolic references, we forget to free
      the looked up reference, resulting in a memory leak when the next
      iteration simply overwrites the variable.
      
      Fix that issue by freeing the reference at the beginning of each
      iteration and collapsing return paths for error and success.
      Patrick Steinhardt committed
  13. 03 Jul, 2017 1 commit
    • Make sure to always include "common.h" first · 0c7f49dd
      Next to including several files, our "common.h" header also declares
      various macros which are then used throughout the project. As such, we
      have to make sure to always include this file first in all
      implementation files. Otherwise, we might encounter problems or even
      silent behavioural differences due to macros or defines not being
      defined as they should be. So in fact, our header and implementation
      files should make sure to always include "common.h" first.
      
      This commit does so by establishing a common include pattern. Header
      files inside of "src" will now always include "common.h" as its first
      other file, separated by a newline from all the other includes to make
      it stand out as special. There are two cases for the implementation
      files. If they do have a matching header file, they will always include
      this one first, leading to "common.h" being transitively included as
      first file. If they do not have a matching header file, they instead
      include "common.h" as first file themselves.
      
      This fixes the outlined problems and will become our standard practice
      for header and source files inside of the "src/" from now on.
      Patrick Steinhardt committed
  14. 10 Jun, 2017 1 commit
    • smart_protocol: fix parsing of server ACK responses · e141f079
      Fix ACK parsing in wait_while_ack() internal function. This patch
      handles the case where multi_ack_detailed mode sends 'ready' ACKs. The
      existing functionality would bail out too early, thus causing the
      processing of the ensuing packfile to fail if/when 'ready' ACKs were
      sent.
      Roger Gee committed
  15. 10 Feb, 2017 1 commit
  16. 06 Jan, 2017 1 commit
    • smart_pkt: treat empty packet lines as error · 2fdef641
      The Git protocol does not specify what should happen in the case
      of an empty packet line (that is a packet line "0004"). We
      currently indicate success, but do not return a packet in the
      case where we hit an empty line. The smart protocol was not
      prepared to handle such packets in all cases, though, resulting
      in a `NULL` pointer dereference.
      
      Fix the issue by returning an error instead. As such kind of
      packets is not even specified by upstream, this is the right
      thing to do.
      Patrick Steinhardt committed
  17. 29 Dec, 2016 1 commit
  18. 12 Dec, 2016 2 commits
  19. 02 Nov, 2016 2 commits
    • transports: smart: abort receiving packets on end of stream · 62494bf2
      When trying to receive packets from the remote, we loop until
      either an error distinct to `GIT_EBUFS` occurs or until we
      successfully parsed the packet. This does not honor the case
      where we are looping over an already closed socket which has no
      more data, leaving us in an infinite loop if we got a bogus
      packet size or if the remote hang up.
      
      Fix the issue by returning `GIT_EEOF` when we cannot read data
      from the socket anymore.
      Patrick Steinhardt committed
    • transports: smart: abort ref announcement on early end of stream · 61530c49
      When reading a server's reference announcements via the smart
      protocol, we expect the server to send multiple flushes before
      the protocol is finished. If we fail to receive new data from the
      socket, we will only return an end of stream error if we have not
      seen any flush yet.
      
      This logic is flawed in that we may run into an infinite loop
      when receiving a server's reference announcement with a bogus
      flush packet. E.g. assume the last flushing package is changed to
      not be '0000' but instead any other value. In this case, we will
      still await one more flush package and ignore the fact that we
      are not receiving any data from the socket, causing an infinite
      loop.
      
      Fix the issue by always returning `GIT_EEOF` if the socket
      indicates an end of stream.
      Patrick Steinhardt committed
  20. 07 Jun, 2016 1 commit
    • transports: smart: fix potential invalid memory dereferences · 7d02019a
      When we receive a packet of exactly four bytes encoding its
      length as those four bytes it can be treated as an empty line.
      While it is not really specified how those empty lines should be
      treated, we currently ignore them and do not return an error when
      trying to parse it but simply advance the data pointer.
      
      Callers invoking `git_pkt_parse_line` are currently not prepared
      to handle this case as they do not explicitly check this case.
      While they could always reset the passed out-pointer to `NULL`
      before calling `git_pkt_parse_line` and determine if the pointer
      has been set afterwards, it makes more sense to update
      `git_pkt_parse_line` to set the out-pointer to `NULL` itself when
      it encounters such an empty packet. Like this it is guaranteed
      that there will be no invalid memory references to free'd
      pointers.
      
      As such, the issue has been fixed such that `git_pkt_parse_line`
      always sets the packet out pointer to `NULL` when an empty packet
      has been received and callers check for this condition, skipping
      such packets.
      Patrick Steinhardt committed
  21. 08 Mar, 2016 1 commit
  22. 18 Feb, 2016 1 commit
  23. 12 Jan, 2016 1 commit
  24. 14 Aug, 2015 1 commit
  25. 20 May, 2015 1 commit
  26. 14 May, 2015 1 commit
  27. 13 May, 2015 2 commits
    • Remove the callbacks struct from the remote · 8f0104ec
      Having the setting be different from calling its actions was not a great
      idea and made for the sake of the wrong convenience.
      
      Instead of that, accept either fetch options, push options or the
      callbacks when dealing with the remote. The fetch options are currently
      only the callbacks, but more options will be moved from setters and
      getters on the remote to the options.
      
      This does mean passing the same struct along the different functions but
      the typical use-case will only call git_remote_fetch() or
      git_remote_push() and so won't notice much difference.
      Carlos Martín Nieto committed
    • push: remove own copy of callbacks · 05259114
      The push object knows which remote it's associated with, and therefore
      does not need to keep its own copy of the callbacks stored in the
      remote.
      
      Remove the copy and simply access the callbacks struct within the
      remote.
      Carlos Martín Nieto committed
  28. 13 Feb, 2015 1 commit
  29. 29 Dec, 2014 1 commit
  30. 09 Nov, 2014 1 commit
    • push: use the common refspec parser · aad638f3
      There is one well-known and well-tested parser which we should use,
      instead of implementing parsing a second time.
      
      The common parser is also augmented to copy the LHS into the RHS if the
      latter is empty.
      
      The expressions test had to change a bit, as we now catch a bad RHS of a
      refspec locally.
      Carlos Martín Nieto committed