1. 25 8月, 2017 2 次提交
  2. 25 7月, 2017 1 次提交
  3. 18 7月, 2017 1 次提交
  4. 01 7月, 2017 1 次提交
    • S
      hashmap.h: compare function has access to a data field · 7663cdc8
      Stefan Beller 提交于
      When using the hashmap a common need is to have access to caller provided
      data in the compare function. A couple of times we abuse the keydata field
      to pass in the data needed. This happens for example in patch-ids.c.
      
      This patch changes the function signature of the compare function
      to have one more void pointer available. The pointer given for each
      invocation of the compare function must be defined in the init function
      of the hashmap and is just passed through.
      
      Documentation of this new feature is deferred to a later patch.
      This is a rather mechanical conversion, just adding the new pass-through
      parameter.  However while at it improve the naming of the fields of all
      compare functions used by hashmaps by ensuring unused parameters are
      prefixed with 'unused_' and naming the parameters what they are (instead
      of 'unused' make it 'unused_keydata').
      Signed-off-by: NStefan Beller <sbeller@google.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7663cdc8
  5. 24 6月, 2017 2 次提交
  6. 19 6月, 2017 1 次提交
    • M
      for_each_bisect_ref(): don't trim refnames · 03df567f
      Michael Haggerty 提交于
      `for_each_bisect_ref()` is called by `for_each_bad_bisect_ref()` with
      a term "bad". This used to make it call `for_each_ref_in_submodule()`
      with a prefix "refs/bisect/bad". But the latter is the name of the
      reference that is being sought, so the empty string was being passed
      to the callback as the trimmed refname. Moreover, this questionable
      practice was turned into an error by
      
          b9c8e7f2 prefix_ref_iterator: don't trim too much, 2017-05-22
      
      It makes more sense (and agrees better with the documentation of
      `--bisect`) for the callers to receive the full reference names. So
      
      * Add a new function, `for_each_fullref_in_submodule()`, to the refs
        API. This plugs a gap in the existing functionality, analogous to
        `for_each_fullref_in()` but accepting a `submodule` argument.
      
      * Change `for_each_bad_bisect_ref()` to call the new function rather
        than `for_each_ref_in_submodule()`.
      
      * Add a test.
      Signed-off-by: NMichael Haggerty <mhagger@alum.mit.edu>
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      03df567f
  7. 16 6月, 2017 1 次提交
  8. 23 5月, 2017 9 次提交
  9. 08 5月, 2017 1 次提交
    • B
      refs: convert struct ref_update to use struct object_id · 98491298
      brian m. carlson 提交于
      Convert struct ref_array_item to use struct object_id by changing the
      definition and applying the following semantic patch, plus the standard
      object_id transforms:
      
      @@
      struct ref_update E1;
      @@
      - E1.new_sha1
      + E1.new_oid.hash
      
      @@
      struct ref_update *E1;
      @@
      - E1->new_sha1
      + E1->new_oid.hash
      
      @@
      struct ref_update E1;
      @@
      - E1.old_sha1
      + E1.old_oid.hash
      
      @@
      struct ref_update *E1;
      @@
      - E1->old_sha1
      + E1->old_oid.hash
      
      This transformation allows us to convert write_ref_to_lockfile, which is
      required to convert parse_object.
      Signed-off-by: Nbrian m. carlson <sandals@crustytoothpaste.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      98491298
  10. 27 4月, 2017 1 次提交
    • J
      timestamp_t: a new data type for timestamps · dddbad72
      Johannes Schindelin 提交于
      Git's source code assumes that unsigned long is at least as precise as
      time_t. Which is incorrect, and causes a lot of problems, in particular
      where unsigned long is only 32-bit (notably on Windows, even in 64-bit
      versions).
      
      So let's just use a more appropriate data type instead. In preparation
      for this, we introduce the new `timestamp_t` data type.
      
      By necessity, this is a very, very large patch, as it has to replace all
      timestamps' data type in one go.
      
      As we will use a data type that is not necessarily identical to `time_t`,
      we need to be very careful to use `time_t` whenever we interact with the
      system functions, and `timestamp_t` everywhere else.
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      dddbad72
  11. 25 4月, 2017 2 次提交
  12. 17 4月, 2017 3 次提交
  13. 14 4月, 2017 7 次提交
  14. 31 3月, 2017 1 次提交
    • J
      avoid using mksnpath for refs · 6cd4a898
      Jeff King 提交于
      Like the previous commit, we'd like to avoid the assumption
      that refs fit into PATH_MAX-sized buffers. These callsites
      have an extra twist, though: they write the refnames using
      mksnpath. This does two things beyond a regular snprintf:
      
        1. It quietly writes "/bad-path/" when truncation occurs.
           This saves the caller having to check the error code,
           but if you aren't actually feeding the result to a
           system call (and we aren't here), it's questionable.
      
        2. It calls cleanup_path(), which removes leading
           instances of "./".  That's questionable when dealing
           with refnames, as we could silently canonicalize a
           syntactically bogus refname into a valid one.
      
      Let's convert each case to use a strbuf. This is preferable
      to xstrfmt() because we can reuse the same buffer as we
      loop.
      Signed-off-by: NJeff King <peff@peff.net>
      6cd4a898
  15. 28 3月, 2017 6 次提交
  16. 24 3月, 2017 1 次提交