1. 10 5月, 2018 3 次提交
    • M
      refs.c: do not die if locking fails in `delete_pseudoref()` · 3c6fad4a
      Martin Ågren 提交于
      After taking the lock we check whether we got it and die otherwise. But
      since we take the lock using `LOCK_DIE_ON_ERROR`, we would already have
      died.
      
      Considering the choice between dropping the dead code and dropping the
      flag, let's go for option number three: Drop the flag, write an error
      instead of dying, then return -1. This function already returns -1 for
      another error, so the caller (or rather, its callers) should be able to
      handle this. There is some inconsistency around how we handle errors in
      this function and elsewhere in this file, but let's take this small step
      towards gentle error-reporting now and leave the rest for another time.
      
      While at it, make the lock non-static and reduce its scope. (Placing
      `struct lock_file`s on the stack used to be a bad idea, because the
      temp- and lockfile-machinery would keep a pointer into the struct. But
      after 076aa2cb (tempfile: auto-allocate tempfiles on heap, 2017-09-05),
      we can safely have lockfiles on the stack.)
      Signed-off-by: NMartin Ågren <martin.agren@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      3c6fad4a
    • M
      refs.c: do not die if locking fails in `write_pseudoref()` · 01084515
      Martin Ågren 提交于
      If we could not take the lock, we add an error to the `strbuf err` and
      return. However, this code is dead. The reason is that we take the lock
      using `LOCK_DIE_ON_ERROR`. Drop the flag to allow our more gentle
      error-handling to actually kick in.
      
      We could instead just drop the dead code and die here. But everything is
      prepared for gently propagating the error, so let's do that instead.
      
      There is similar dead code in `delete_pseudoref()`, but let's save that
      for the next patch.
      
      While at it, make the lock non-static. (Placing `struct lock_file`s on
      the stack used to be a bad idea, because the temp- and
      lockfile-machinery would keep a pointer into the struct. But after
      076aa2cb (tempfile: auto-allocate tempfiles on heap, 2017-09-05), we
      can safely have lockfiles on the stack.)
      Reviewed-by: NStefan Beller <sbeller@google.com>
      Signed-off-by: NMartin Ågren <martin.agren@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      01084515
    • M
      t/helper/test-write-cache: clean up lock-handling · 75d9a25e
      Martin Ågren 提交于
      Die in case writing the index fails, so that the caller can notice
      (instead of, say, being impressed by how performant the writing is).
      
      While at it, note that after opening a lock with `LOCK_DIE_ON_ERROR`, we
      do not need to worry about whether we succeeded. Also, we can move the
      `struct lock_file` into the function and drop the staticness. (Placing
      `struct lock_file`s on the stack used to be a bad idea, because the
      temp- and lockfile-machinery would keep a pointer into the struct. But
      after 076aa2cb (tempfile: auto-allocate tempfiles on heap, 2017-09-05),
      we can safely have lockfiles on the stack.)
      Signed-off-by: NMartin Ågren <martin.agren@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      75d9a25e
  2. 03 4月, 2018 3 次提交
    • J
      Git 2.17 · 468165c1
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      468165c1
    • J
      Merge tag 'l10n-2.17.0-rnd1' of git://github.com/git-l10n/git-po · 1614dd0f
      Junio C Hamano 提交于
      l10n for Git 2.17.0 round 1
      
      * tag 'l10n-2.17.0-rnd1' of git://github.com/git-l10n/git-po:
        l10n: de.po: translate 132 new messages
        l10n: zh_CN: review for git v2.17.0 l10n round 1
        l10n: zh_CN: for git v2.17.0 l10n round 1
        l10n: ko.po: Update Korean translation
        l10n: fr.po: v2.17.0 no fuzzy
        l10n: sv.po: Update Swedish translation (3376t0f0u)
        l10n: Update Catalan translation
        l10n: fr.po v2.17.0 round 1
        l10n: vi.po(3376t): Updated Vietnamese translation for v2.17
        l10n: bg.po: Updated Bulgarian translation (3376t)
        l10n: es.po: Update Spanish translation 2.17.0
        l10n: git.pot: v2.17.0 round 1 (132 new, 44 removed)
        l10n: es.po: fixes to Spanish translation
      1614dd0f
    • J
      Merge branch 'pw/add-p-single' · 5f944176
      Junio C Hamano 提交于
      Hotfix.
      
      * pw/add-p-single:
        add -p: fix 2.17.0-rc* regression due to moved code
      5f944176
  3. 01 4月, 2018 1 次提交
    • Æ
      add -p: fix 2.17.0-rc* regression due to moved code · fd2fb4aa
      Ævar Arnfjörð Bjarmason 提交于
      Fix a regression in 88f6ffc1 ("add -p: only bind search key if
      there's more than one hunk", 2018-02-13) which is present in
      2.17.0-rc*, but not 2.16.0.
      
      In Perl, regex variables like $1 always refer to the last regex
      match. When the aforementioned change added a new regex match between
      the old match and the corresponding code that was expecting $1, the $1
      variable would always be undef, since the newly inserted regex match
      doesn't have any captures.
      
      As a result the "/" feature to search for a string in a hunk by regex
      completely broke, on git.git:
      
          $ perl -pi -e 's/Git/Tig/g' README.md
          $ ./git --exec-path=$PWD add -p
          [..]
          Stage this hunk [y,n,q,a,d,j,J,g,/,s,e,?]? s
          Split into 4 hunks.
          [...]
          Stage this hunk [y,n,q,a,d,j,J,g,/,s,e,?]? /Many
          Use of uninitialized value $1 in string eq at /home/avar/g/git/git-add--interactive line 1568, <STDIN> line 1.
          search for regex? Many
      
      I.e. the initial "/regex" command wouldn't work, and would always emit
      a warning and ask again for a regex, now it works as intended again.
      Signed-off-by: NÆvar Arnfjörð Bjarmason <avarab@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      fd2fb4aa
  4. 31 3月, 2018 1 次提交
  5. 30 3月, 2018 2 次提交
    • J
      Merge branch 'jh/partial-clone' · c2a499e6
      Junio C Hamano 提交于
      Hotfix.
      
      * jh/partial-clone:
        upload-pack: disable object filtering when disabled by config
        unpack-trees: release oid_array after use in check_updates()
      c2a499e6
    • J
      upload-pack: disable object filtering when disabled by config · c7620bd0
      Jonathan Nieder 提交于
      When upload-pack gained partial clone support (v2.17.0-rc0~132^2~12,
      2017-12-08), it was guarded by the uploadpack.allowFilter config item
      to allow server operators to control when they start supporting it.
      
      That config item didn't go far enough, though: it controls whether the
      'filter' capability is advertised, but if a (custom) client ignores
      the capability advertisement and passes a filter specification anyway,
      the server would handle that despite allowFilter being false.
      
      This is particularly significant if a security bug is discovered in
      this new experimental partial clone code.  Installations without
      uploadpack.allowFilter ought not to be affected since they don't
      intend to support partial clone, but they would be swept up into being
      vulnerable.
      
      Simplify and limit the attack surface by making uploadpack.allowFilter
      disable the feature, not just the advertisement of it.
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c7620bd0
  6. 29 3月, 2018 6 次提交
  7. 28 3月, 2018 3 次提交
  8. 26 3月, 2018 1 次提交
  9. 25 3月, 2018 1 次提交
  10. 24 3月, 2018 2 次提交
  11. 23 3月, 2018 17 次提交