1. 17 Dec, 2014 7 commits
    • Jeff King's avatar
      read-cache: optionally disallow HFS+ .git variants · a42643aa
      Jeff King authored
      The point of disallowing ".git" in the index is that we
      would never want to accidentally overwrite files in the
      repository directory. But this means we need to respect the
      filesystem's idea of when two paths are equal. The prior
      commit added a helper to make such a comparison for HFS+;
      let's use it in verify_path.
      
      We make this check optional for two reasons:
      
        1. It restricts the set of allowable filenames, which is
           unnecessary for people who are not on HFS+. In practice
           this probably doesn't matter, though, as the restricted
           names are rather obscure and almost certainly would
           never come up in practice.
      
        2. It has a minor performance penalty for every path we
           insert into the index.
      
      This patch ties the check to the core.protectHFS config
      option. Though this is expected to be most useful on OS X,
      we allow it to be set everywhere, as HFS+ may be mounted on
      other platforms. The variable does default to on for OS X,
      though.
      Signed-off-by: default avatarJeff King <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      a42643aa
    • Jeff King's avatar
      utf8: add is_hfs_dotgit() helper · 6162a1d3
      Jeff King authored
      We do not allow paths with a ".git" component to be added to
      the index, as that would mean repository contents could
      overwrite our repository files. However, asking "is this
      path the same as .git" is not as simple as strcmp() on some
      filesystems.
      
      HFS+'s case-folding does more than just fold uppercase into
      lowercase (which we already handle with strcasecmp). It may
      also skip past certain "ignored" Unicode code points, so
      that (for example) ".gi\u200ct" is mapped ot ".git".
      
      The full list of folds can be found in the tables at:
      
        https://www.opensource.apple.com/source/xnu/xnu-1504.15.3/bsd/hfs/hfscommon/Unicode/UCStringCompareData.h
      
      Implementing a full "is this path the same as that path"
      comparison would require us importing the whole set of
      tables.  However, what we want to do is much simpler: we
      only care about checking ".git". We know that 'G' is the
      only thing that folds to 'g', and so on, so we really only
      need to deal with the set of ignored code points, which is
      much smaller.
      Signed-off-by: default avatarJeff King <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      6162a1d3
    • Jeff King's avatar
      fsck: notice .git case-insensitively · 76e86fc6
      Jeff King authored
      We complain about ".git" in a tree because it cannot be
      loaded into the index or checked out. Since we now also
      reject ".GIT" case-insensitively, fsck should notice the
      same, so that errors do not propagate.
      Signed-off-by: default avatarJeff King <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      76e86fc6
    • Jeff King's avatar
      t1450: refactor ".", "..", and ".git" fsck tests · 450870cb
      Jeff King authored
      We check that fsck notices and complains about confusing
      paths in trees. However, there are a few shortcomings:
      
        1. We check only for these paths as file entries, not as
           intermediate paths (so ".git" and not ".git/foo").
      
        2. We check "." and ".." together, so it is possible that
           we notice only one and not the other.
      
        3. We repeat a lot of boilerplate.
      
      Let's use some loops to be more thorough in our testing, and
      still end up with shorter code.
      Signed-off-by: default avatarJeff King <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      450870cb
    • Jeff King's avatar
      verify_dotfile(): reject .git case-insensitively · cc2fc7c2
      Jeff King authored
      We do not allow ".git" to enter into the index as a path
      component, because checking out the result to the working
      tree may causes confusion for subsequent git commands.
      However, on case-insensitive file systems, ".Git" or ".GIT"
      is the same. We should catch and prevent those, too.
      
      Note that technically we could allow this for repos on
      case-sensitive filesystems. But there's not much point. It's
      unlikely that anybody cares, and it creates a repository
      that is unexpectedly non-portable to other systems.
      Signed-off-by: default avatarJeff King <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      cc2fc7c2
    • Jeff King's avatar
      read-tree: add tests for confusing paths like ".." and ".git" · 96b50cc1
      Jeff King authored
      We should prevent nonsense paths from entering the index in
      the first place, as they can cause confusing results if they
      are ever checked out into the working tree. We already do
      so, but we never tested it.
      Signed-off-by: default avatarJeff King <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      96b50cc1
    • Jeff King's avatar
      unpack-trees: propagate errors adding entries to the index · 46169180
      Jeff King authored
      When unpack_trees tries to write an entry to the index,
      add_index_entry may report an error to stderr, but we ignore
      its return value. This leads to us returning a successful
      exit code for an operation that partially failed. Let's make
      sure to propagate this code.
      Signed-off-by: default avatarJeff King <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      46169180
  2. 27 Nov, 2013 3 commits
  3. 25 Nov, 2013 1 commit
  4. 20 Nov, 2013 4 commits
  5. 18 Nov, 2013 7 commits
  6. 13 Nov, 2013 1 commit
  7. 12 Nov, 2013 5 commits
  8. 10 Nov, 2013 1 commit
  9. 09 Nov, 2013 1 commit
  10. 08 Nov, 2013 7 commits
    • Jean-Noël Avila's avatar
      eadd122b
    • Junio C Hamano's avatar
      Sync with 1.8.4.3 · 0ecd94d7
      Junio C Hamano authored
      0ecd94d7
    • Junio C Hamano's avatar
      Git 1.8.4.3 · d7d2c879
      Junio C Hamano authored
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      d7d2c879
    • Junio C Hamano's avatar
      Merge branch 'jn/test-prereq-perl-doc' into maint · cdc0c0f5
      Junio C Hamano authored
      The interaction between use of Perl in our test suite and NO_PERL
      has been clarified a bit.
      
      * jn/test-prereq-perl-doc:
        t/README: tests can use perl even with NO_PERL
      cdc0c0f5
    • Junio C Hamano's avatar
      Merge branch 'ap/remote-hg-unquote-cquote' into maint · 4bc3d3fc
      Junio C Hamano authored
      A fast-import stream expresses a pathname with funny characters by
      quoting them in C style; remote-hg remote helper (in contrib/)
      forgot to unquote such a path.
      
      * ap/remote-hg-unquote-cquote:
        remote-hg: unquote C-style paths when exporting
      4bc3d3fc
    • Junio C Hamano's avatar
      Merge branch 'jc/upload-pack-send-symref' into maint · 9196a2f8
      Junio C Hamano authored
      One long-standing flaw in the pack transfer protocol used by "git
      clone" was that there was no way to tell the other end which branch
      "HEAD" points at, and the receiving end needed to guess.  A new
      capability has been defined in the pack protocol to convey this
      information so that cloning from a repository with more than one
      branches pointing at the same commit where the HEAD is at now
      reliably sets the initial branch in the resulting repository.
      
      * jc/upload-pack-send-symref:
        t5570: Update for clone-progress-to-stderr branch
        t5570: Update for symref capability
        clone: test the new HEAD detection logic
        connect: annotate refs with their symref information in get_remote_head()
        connect.c: make parse_feature_value() static
        upload-pack: send non-HEAD symbolic refs
        upload-pack: send symbolic ref information as capability
        upload-pack.c: do not pass confusing cb_data to mark_our_ref()
        t5505: fix "set-head --auto with ambiguous HEAD" test
      9196a2f8
    • Junio C Hamano's avatar
      Merge branch 'jk/http-auth-redirects' into maint · e5becd04
      Junio C Hamano authored
      We did not handle cases where http transport gets redirected during
      the authorization request (e.g. from http:// to https://).
      
      * jk/http-auth-redirects:
        http.c: Spell the null pointer as NULL
        remote-curl: rewrite base url from info/refs redirects
        remote-curl: store url as a strbuf
        remote-curl: make refs_url a strbuf
        http: update base URLs when we see redirects
        http: provide effective url to callers
        http: hoist credential request out of handle_curl_result
        http: refactor options to http_get_*
        http_request: factor out curlinfo_strbuf
        http_get_file: style fixes
      e5becd04
  11. 07 Nov, 2013 3 commits