1. 01 Jun, 2020 1 commit
  2. 31 Jan, 2020 1 commit
    • fetchhead: strip credentials from remote URL · 93a9044f
      If fetching from an anonymous remote via its URL, then the URL gets
      written into the FETCH_HEAD reference. This is mainly done to give
      valuable context to some commands, like for example git-merge(1), which
      will put the URL into the generated MERGE_MSG. As a result, what gets
      written into FETCH_HEAD may become public in some cases. This is
      especially important considering that URLs may contain credentials, e.g.
      when cloning 'https://foo:bar@example.com/repo' we persist the complete
      URL into FETCH_HEAD and put it without any kind of sanitization into the
      MERGE_MSG. This is obviously bad, as your login data has now just leaked
      as soon as you do git-push(1).
      
      When writing the URL into FETCH_HEAD, upstream git does strip
      credentials first. Let's do the same by trying to parse the remote URL
      as a "real" URL, removing any credentials and then re-formatting the
      URL. In case this fails, e.g. when it's a file path or not a valid URL,
      we just fall back to using the URL as-is without any sanitization. Add
      tests to verify our behaviour.
      Patrick Steinhardt committed
  3. 20 Jul, 2019 1 commit
  4. 24 Jun, 2019 1 commit
  5. 10 Jun, 2018 1 commit
  6. 27 Oct, 2016 1 commit
  7. 04 Aug, 2016 1 commit
    • refspec: do not set empty rhs for fetch refspecs · 1eee631d
      According to git-fetch(1), "[t]he colon can be omitted when <dst>
      is empty." So according to git, the refspec "refs/heads/master"
      is the same as the refspec "refs/heads/master:" when fetching
      changes. When trying to fetch from a remote with a trailing
      colon with libgit2, though, the fetch actually fails while it
      works when the trailing colon is left out. So obviously, libgit2
      does _not_ treat these two refspec formats the same for fetches.
      
      The problem results from parsing refspecs, where the resulting
      refspec has its destination set to an empty string in the case of
      a trailing colon and to a `NULL` pointer in the case of no
      trailing colon. When passing this to our DWIM machinery, the
      empty string gets translated to "refs/heads/", which is simply
      wrong.
      
      Fix the problem by having the parsing machinery treat both cases
      the same for fetch refspecs.
      Patrick Steinhardt committed
  8. 13 May, 2015 2 commits
    • remote: move the tagopt setting to the fetch options · 35a8a8c5
      This is another option which we should not be keeping in the remote, but
      is specific to each particular operation.
      Carlos Martín Nieto committed
    • 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
  9. 03 Mar, 2015 1 commit
    • Remove the signature from ref-modifying functions · 659cf202
      The signature for the reflog is not something which changes
      dynamically. Almost all uses will be NULL, since we want for the
      repository's default identity to be used, making it noise.
      
      In order to allow for changing the identity, we instead provide
      git_repository_set_ident() and git_repository_ident() which allow a user
      to override the choice of signature.
      Carlos Martín Nieto committed
  10. 08 Nov, 2014 1 commit
  11. 30 Sep, 2014 2 commits
  12. 05 Sep, 2014 1 commit
  13. 05 Feb, 2014 1 commit
  14. 14 Nov, 2013 1 commit
  15. 02 Oct, 2013 2 commits
  16. 10 Jun, 2013 1 commit
    • Reorganize diff and add basic diff driver · 114f5a6c
      This is a significant reorganization of the diff code to break it
      into a set of more clearly distinct files and to document the new
      organization.  Hopefully this will make the diff code easier to
      understand and to extend.
      
      This adds a new `git_diff_driver` object that looks of diff driver
      information from the attributes and the config so that things like
      function content in diff headers can be provided.  The full driver
      spec is not implemented in the commit - this is focused on the
      reorganization of the code and putting the driver hooks in place.
      
      This also removes a few #includes from src/repository.h that were
      overbroad, but as a result required extra #includes in a variety
      of places since including src/repository.h no longer results in
      pulling in the whole world.
      Russell Belfer committed
  17. 20 Apr, 2013 2 commits
    • remote: allow querying for refspecs · bc6374ea
      Introduce git_remote_{fetch,push}_refspecs() to get a list of refspecs
      from the remote and rename the refspec-adding functions to a less
      silly name.
      
      Use this instead of the vector index hacks in the tests.
      Carlos Martín Nieto committed
    • remote: handle multiple refspecs · 4330ab26
      A remote can have a multitude of refspecs. Up to now our git_remote's
      have supported a single one for each fetch and push out of simplicity
      to get something working.
      
      Let the remotes and internal code know about multiple remotes and get
      the tests passing with them.
      
      Instead of setting a refspec, the external users can clear all and add
      refspecs. This should be enough for most uses, though we're still
      missing a querying function.
      Carlos Martín Nieto committed
  18. 09 Mar, 2013 1 commit
  19. 06 Feb, 2013 1 commit
  20. 02 Jan, 2013 2 commits
  21. 20 Dec, 2012 1 commit
  22. 15 Dec, 2012 1 commit
  23. 14 Dec, 2012 2 commits
  24. 13 Dec, 2012 2 commits
  25. 27 Nov, 2012 1 commit
  26. 23 Nov, 2012 1 commit
    • Reset all static variables to NULL in clar's __cleanup · 9094d30b
      Without this change, any failed assertion in the second (or a later) test
      inside a test suite has a chance of double deleting memory, resulting in
      a heap corruption. See #1096 for details.
      
      This leaves alone the test cases where we "just" use cl_git_sandbox_init()
      and cl_git_sandbox_cleanup(). These methods already take good care to not
      double delete a repository.
      
      Fixes #1096
      Sascha Cunz committed
  27. 22 Nov, 2012 1 commit
  28. 11 Nov, 2012 1 commit