1. 22 Feb, 2019 1 commit
  2. 14 Feb, 2019 3 commits
    • branch: fix `branch_is_checked_out` with bare repos · bf013fc0
      In a bare repository, HEAD usually points to the branch that is
      considered the "default" branch. As the current implementation for
      `git_branch_is_checked_out` only does a comparison of HEAD with the
      branch that is to be checked, it will say that the branch pointed to by
      HEAD in such a bare repo is checked out.
      
      Fix this by skipping the main repo's HEAD when it is bare.
      Patrick Steinhardt committed
    • branches: do not assert that the given ref is a branch · 788cd2d5
      Libraries should use assert(3P) only very scarcely. First, we usually
      shouldn't cause the caller of our library to abort in case where the
      assert fails. Second, if code is compiled with -DNDEBUG, then the assert
      will not be included at all.
      
      In our `git_branch_is_checked_out` function, we have an assert that
      verifies that the given reference parameter is non-NULL and in fact a
      branch. While the first check is fine, the second is not. E.g. when
      compiled with -DNDEBUG, we'd proceed and treat the given reference as a
      branch in all cases.
      
      Fix the issue by instead treating a non-branch reference as not being
      checked out. This is the obvious solution, as references other than
      branches cannot be directly checked out.
      Patrick Steinhardt committed
    • branches: add tests for `git_branch_is_checked_out` · a0f87e16
      We currently do not have any tests at all for the
      `git_branch_is_checked_out` function. Add some basic ones.
      Patrick Steinhardt committed
  3. 22 Jan, 2019 1 commit
  4. 17 Jan, 2019 1 commit
  5. 01 Dec, 2018 1 commit
  6. 13 Oct, 2018 1 commit
  7. 10 Jun, 2018 1 commit
  8. 14 Nov, 2017 1 commit
  9. 29 Dec, 2016 1 commit
  10. 04 Nov, 2016 1 commit
    • branch: fix forced branch creation on HEAD of a bare repo · f9793884
      The code correctly detects that forced creation of a branch on a
      nonbare repo should not be able to overwrite a branch which is
      the HEAD reference.  But there's no reason to prevent this on
      a bare repo, and in fact, git allows this.  I.e.,
      
         git branch -f master new_sha
      
      works on a bare repo with HEAD set to master.  This change fixes
      that problem, and updates tests so that, for this case, both the
      bare and nonbare cases are checked for correct behavior.
      John Fultz committed
  11. 12 Jul, 2015 1 commit
  12. 22 May, 2015 1 commit
    • branch: error out if we cannot find the remote · 5014fe95
      When we look for which remote corresponds to a remote-tracking branch,
      we look in the refspecs to see which ones matches. If none do, we should
      abort. We currently ignore the error message from this operation, so
      let's not do that anymore.
      
      As part of the test we're writing, let's test for the expected behaviour
      if we cannot find a refspec which tells us what the remote-tracking
      branch for a remote would look like.
      Carlos Martín Nieto committed
  13. 13 May, 2015 1 commit
    • remote: remove live changing of refspecs · 77254990
      The base refspecs changing can be a cause of confusion as to what is the
      current base refspec set and complicate saving the remote's
      configuration.
      
      Change `git_remote_add_{fetch,push}()` to update the configuration
      instead of an instance.
      
      This finally makes `git_remote_save()` a no-op, it will be removed in a
      later commit.
      Carlos Martín Nieto committed
  14. 16 Mar, 2015 1 commit
  15. 08 Mar, 2015 1 commit
  16. 04 Mar, 2015 2 commits
  17. 03 Mar, 2015 4 commits
  18. 03 Feb, 2015 1 commit
  19. 17 Nov, 2014 1 commit
  20. 08 Nov, 2014 1 commit
  21. 30 May, 2014 2 commits
  22. 08 May, 2014 2 commits
    • Don't always test composed-insensitive lookups · 8a2ef218
      Only on a filesystem that is composed/decomposed insensitive,
      should be testing that a branch can be looked up by the opposite
      form and still work correctly.
      Russell Belfer committed
    • Pass unconverted data when iconv doesn't like it · 43a04135
      When using Iconv to convert unicode data and iconv doesn't like
      the source data (because it thinks that it's not actual UTF-8),
      instead of stopping the operation, just use the unconverted data.
      This will generally do the right thing on the filesystem, since
      that is the source of the non-UTF-8 path data anyhow.
      
      This adds some tests for creating and looking up branches with
      messy Unicode names.  Also, this takes the helper function that
      was previously internal to `git_repository_init` and makes it
      into `git_path_does_fs_decompose_unicode` which is a useful in
      tests to understand what the expected results should be.
      Russell Belfer committed
  23. 02 May, 2014 1 commit
  24. 16 Apr, 2014 1 commit
  25. 02 Mar, 2014 1 commit
  26. 05 Feb, 2014 1 commit
  27. 03 Feb, 2014 1 commit
  28. 31 Jan, 2014 1 commit
  29. 30 Jan, 2014 4 commits