1. 20 Apr, 2018 1 commit
    • local: fix a leaking reference when iterating over a symref · 836ec316
      Valgrind log :
      
      ==17702== 18 bytes in 1 blocks are indirectly lost in loss record 69 of 1,123
      ==17702==    at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==17702==    by 0x5FDBB49: strdup (strdup.c:42)
      ==17702==    by 0x632B3E: git__strdup (util.h:106)
      ==17702==    by 0x632D2C: git_reference__alloc_symbolic (refs.c:64)
      ==17702==    by 0x62E0AF: loose_lookup (refdb_fs.c:408)
      ==17702==    by 0x62E636: refdb_fs_backend__iterator_next (refdb_fs.c:565)
      ==17702==    by 0x62CD8E: git_refdb_iterator_next (refdb.c:147)
      ==17702==    by 0x6347F2: git_reference_next (refs.c:838)
      ==17702==    by 0x6345CB: git_reference_foreach (refs.c:748)
      ==17702==    by 0x66BE62: local_download_pack (local.c:579)
      ==17702==    by 0x5DB48F: git_fetch_download_pack (fetch.c:148)
      ==17702==    by 0x639028: git_remote_download (remote.c:932)
      ==17702==    by 0x63919A: git_remote_fetch (remote.c:969)
      ==17702==    by 0x4ABEDD: test_fetchhead_nonetwork__fetch_into_repo_with_symrefs (nonetwork.c:362)
      ==17702==    by 0x4125D9: clar_run_test (clar.c:222)
      ==17702==    by 0x41287C: clar_run_suite (clar.c:286)
      ==17702==    by 0x412DDE: clar_test_run (clar.c:433)
      ==17702==    by 0x4105E1: main (main.c:24)
      Etienne Samson committed
  2. 11 Apr, 2018 5 commits
  3. 06 Apr, 2018 1 commit
    • transports: local: fix assert when fetching into repo with symrefs · 6c55fbf3
      When fetching into a repository which has symbolic references via the
      "local" transport we run into an assert. The assert is being triggered
      while we negotiate the packfile between the two repositories. When
      hiding known revisions from the packbuilder revwalk, we unconditionally
      hide all references of the local refdb. In case one of these references
      is a symbolic reference, though, this means we're trying to hide a
      `NULL` OID, which triggers the assert.
      
      Fix the issue by only hiding OID references from the revwalk. Add a test
      to catch this issue in the future.
      Patrick Steinhardt committed
  4. 27 Mar, 2018 2 commits
    • transports: ssh: replace deprecated function `libssh2_session_startup` · 874ce161
      The function `libssh2_session_startup` has been deprecated since libssh2
      version 1.2.8 in favor of `libssh2_session_handshake` introduced in the
      same version. libssh2 1.2.8 was released in April 2011, so it is already
      seven years old. It is available in Debian Wheezy, Ubuntu Trusty and
      CentOS 7.4, so the most important and conservative distros already have
      it available. As such, it seems safe to just use the new function.
      Patrick Steinhardt committed
    • transports: ssh: disconnect session before freeing it · 2785cc8e
      The function `ssh_stream_free` takes over the responsibility of closing
      channels and streams just before freeing their memory, but it does not
      do so for the session. In fact, we never disconnect the session
      ourselves at all, as libssh2 will not do so itself upon freeing the
      structure. Quoting the documentation of `libssh2_session_free`:
      
          > Frees all resources associated with a session instance. Typically
          > called after libssh2_session_disconnect_ex,
      
      The missing disconnect probably stems from a misunderstanding what it
      actually does. As we are already closing the TCP socket ourselves, the
      assumption was that no additional disconnect is required. But calling
      `libssh2_session_disconnect` will notify the server that we are cleanly
      closing the connection, such that the server can free his own resources.
      
      Add a call to `libssh2_session_disconnect` to fix that issue.
      
      [1]: https://www.libssh2.org/libssh2_session_free.html
      Patrick Steinhardt committed
  5. 19 Mar, 2018 2 commits
  6. 27 Feb, 2018 3 commits
    • winhttp: enable TLS 1.2 on Windows 7 and earlier · 5ecb6220
      Versions of Windows prior to Windows 8 do not enable TLS 1.2 by default,
      though support may exist.  Try to enable TLS 1.2 support explicitly on
      connections.
      
      This request may fail if the operating system does not have TLS 1.2
      support - the initial release of Vista lacks TLS 1.2 support (though
      it is available as a software update) and XP completely lacks TLS 1.2
      support.  If this request does fail, the HTTP context is still valid,
      and still maintains the original protocol support.  So we ignore the
      failure from this operation.
      Edward Thomson committed
    • winhttp: include constants for TLS 1.1/1.2 support · 934e6a3b
      For platforms that do not define `WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1`
      and/or `WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2`.
      Edward Thomson committed
    • mingw: update TLS option flags · 8c8db980
      Include the constants for `WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1` and
      `WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2` so that they can be used by mingw.
      
      This updates both the `deps/winhttp` framework (for classic mingw) and
      adds the defines for mingw64, which does not use that framework.
      Edward Thomson committed
  7. 10 Feb, 2018 1 commit
    • http: standardize user-agent addition · ee6be190
      The winhttp and posix http each need to add the user-agent to their
      requests.  Standardize on a single function to include this so that we
      do not get the version numbers we're sending out of sync.
      
      Assemble the complete user agent in `git_http__user_agent`, returning
      assembled strings.
      
      Co-authored-by: Patrick Steinhardt <ps@pks.im>
      Edward Thomson committed
  8. 01 Feb, 2018 1 commit
  9. 12 Jan, 2018 1 commit
  10. 29 Dec, 2017 1 commit
  11. 26 Nov, 2017 1 commit
  12. 23 Oct, 2017 1 commit
  13. 20 Oct, 2017 1 commit
  14. 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
  15. 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
  16. 10 Jun, 2017 1 commit
  17. 08 Jun, 2017 1 commit
  18. 02 May, 2017 2 commits
  19. 17 Apr, 2017 1 commit
  20. 01 Mar, 2017 1 commit
  21. 13 Feb, 2017 1 commit
    • repository: use `git_repository_item_path` · c5f3da96
      The recent introduction of the commondir variable of a repository
      requires callers to distinguish whether their files are part of
      the dot-git directory or the common directory shared between
      multpile worktrees. In order to take the burden from callers and
      unify knowledge on which files reside where, the
      `git_repository_item_path` function has been introduced which
      encapsulate this knowledge.
      
      Modify most existing callers of `git_repository_path` to use
      `git_repository_item_path` instead, thus making them implicitly
      aware of the common directory.
      Patrick Steinhardt committed
  22. 10 Feb, 2017 1 commit
  23. 06 Feb, 2017 2 commits
  24. 27 Jan, 2017 1 commit
  25. 21 Jan, 2017 1 commit
  26. 16 Jan, 2017 1 commit
  27. 06 Jan, 2017 3 commits
  28. 29 Dec, 2016 1 commit