]> git.proxmox.com Git - libgit2.git/commitdiff
Merge remote-tracking branch 'nulltoken/topic/amd64-compat' into development
authorVicent Marti <tanoku@gmail.com>
Wed, 1 Aug 2012 23:38:30 +0000 (01:38 +0200)
committerVicent Marti <tanoku@gmail.com>
Wed, 1 Aug 2012 23:38:30 +0000 (01:38 +0200)
Conflicts:
src/netops.c
src/netops.h
src/oid.c

13 files changed:
1  2 
include/git2/odb_backend.h
include/git2/oid.h
include/git2/reflog.h
src/attr.c
src/attr_file.c
src/date.c
src/netops.c
src/netops.h
src/odb_pack.c
src/oid.c
src/reflog.c
src/revparse.c
src/status.c

Simple merge
Simple merge
index a73d1f7fd5a664ef25483efd1858ecf7f608628a,175ea79caf010bf2d84bcc25beb967e60f8fff72..447915ef8f6b9974d1d19393b39751ce16bf8cd2
@@@ -92,28 -84,8 +92,28 @@@ GIT_EXTERN(unsigned int) git_reflog_ent
   * @param idx the position to lookup
   * @return the entry; NULL if not found
   */
- GIT_EXTERN(const git_reflog_entry *) git_reflog_entry_byindex(git_reflog *reflog, unsigned int idx);
+ GIT_EXTERN(const git_reflog_entry *) git_reflog_entry_byindex(git_reflog *reflog, size_t idx);
  
 +/**
 + * Remove an entry from the reflog by its index
 + *
 + * To ensure there's no gap in the log history, set the `rewrite_previosu_entry` to 1.
 + * When deleting entry `n`, member old_oid of entry `n-1` (if any) will be updated with
 + * the value of memeber new_oid of entry `n+1`.
 + *
 + * @param reflog a previously loaded reflog.
 + *
 + * @param idx the position of the entry to remove.
 + *
 + * @param rewrite_previous_entry 1 to rewrite the history; 0 otherwise.
 + *
 + * @return 0 on success or an error code.
 + */
 +GIT_EXTERN(int) git_reflog_drop(
 +      git_reflog *reflog,
 +      unsigned int idx,
 +      int rewrite_previous_entry);
 +
  /**
   * Get the old oid
   *
diff --cc src/attr.c
Simple merge
diff --cc src/attr_file.c
Simple merge
diff --cc src/date.c
index f0e637a45486ef19905f9405bdcdd1863c772436,f44da04e3744ad19b5dfe0e78bda9dcee3710904..965e6caabc0f51fa3d0fc0066b7f9be61feaba20
@@@ -170,8 -170,8 +170,8 @@@ static size_t match_alpha(const char *d
        }
  
        for (i = 0; i < ARRAY_SIZE(timezone_names); i++) {
-               int match = match_string(date, timezone_names[i].name);
-               if (match >= 3 || match == (int)strlen(timezone_names[i].name)) {
+               size_t match = match_string(date, timezone_names[i].name);
 -              if (match >= 3 || match == (int)strlen(timezone_names[i].name)) {
++              if (match >= 3 || match == strlen(timezone_names[i].name)) {
                        int off = timezone_names[i].offset;
  
                        /* This is bogus, but we like summer */
diff --cc src/netops.c
index 72c1757f2694c5a1b5c70c3dc3bc0cdb596b96b2,7c057c596db3583309b1ec0036ec563e32490051..49a0308bb1013ef5eecc845dfb96b0ad38b4e382
@@@ -99,29 -118,6 +99,34 @@@ int gitno__recv(gitno_buffer *buf
        return ret;
  }
  
- void gitno_buffer_setup_callback(git_transport *t, gitno_buffer *buf, char *data, unsigned int len, int (*recv)(gitno_buffer *buf), void *cb_data)
++void gitno_buffer_setup_callback(
++      git_transport *t,
++      gitno_buffer *buf,
++      char *data,
++      size_t len,
++      int (*recv)(gitno_buffer *buf), void *cb_data)
 +{
 +      memset(buf, 0x0, sizeof(gitno_buffer));
 +      memset(data, 0x0, len);
 +      buf->data = data;
 +      buf->len = len;
 +      buf->offset = 0;
 +      buf->fd = t->socket;
 +      buf->recv = recv;
 +      buf->cb_data = cb_data;
 +}
 +
- void gitno_buffer_setup(git_transport *t, gitno_buffer *buf, char *data, unsigned int len)
++void gitno_buffer_setup(git_transport *t, gitno_buffer *buf, char *data, size_t len)
 +{
 +#ifdef GIT_SSL
 +      if (t->use_ssl) {
 +              gitno_buffer_setup_callback(t, buf, data, len, gitno__recv_ssl, NULL);
 +              buf->ssl = &t->ssl;
 +      } else
 +#endif
 +              gitno_buffer_setup_callback(t, buf, data, len, gitno__recv, NULL);
 +}
 +
  /* Consume up to ptr and move the rest of the buffer to the beginning */
  void gitno_consume(gitno_buffer *buf, const char *ptr)
  {
diff --cc src/netops.h
index dded55b63eb14b9a8688020653f34798c1361663,5541ec888b78194f16638edd0c621096c6cde6c3..7c53fd0dc8688dfac5628fbe9ec2c4bbe0a5f853
@@@ -18,14 -19,10 +18,14 @@@ struct gitno_buffer 
  #ifdef GIT_SSL
        struct gitno_ssl *ssl;
  #endif
 -} gitno_buffer;
 +      int (*recv)(gitno_buffer *buffer);
 +      void *cb_data;
 +};
  
- void gitno_buffer_setup(git_transport *t, gitno_buffer *buf, char *data, unsigned int len);
- void gitno_buffer_setup_callback(git_transport *t, gitno_buffer *buf, char *data, unsigned int len, int (*recv)(gitno_buffer *buf), void *cb_data);
+ void gitno_buffer_setup(git_transport *t, gitno_buffer *buf, char *data, size_t len);
++void gitno_buffer_setup_callback(git_transport *t, gitno_buffer *buf, char *data, size_t len, int (*recv)(gitno_buffer *buf), void *cb_data);
  int gitno_recv(gitno_buffer *buf);
 +int gitno__recv(gitno_buffer *buf);
  
  void gitno_consume(gitno_buffer *buf, const char *ptr);
  void gitno_consume_n(gitno_buffer *buf, size_t cons);
diff --cc src/odb_pack.c
Simple merge
diff --cc src/oid.c
index 556a2cf852a69f8cfab768d69fd606991a6c8d2b,888fe3e6b86c79d46a9f0187c5393fc5d3095fda..821442d1985da71ff3e14d52f2f700517bd2d4c5
+++ b/src/oid.c
@@@ -161,7 -161,12 +161,7 @@@ void git_oid_cpy(git_oid *out, const gi
        memcpy(out->id, src->id, sizeof(out->id));
  }
  
- int git_oid_ncmp(const git_oid *oid_a, const git_oid *oid_b, unsigned int len)
 -int git_oid_cmp(const git_oid *a, const git_oid *b)
 -{
 -      return memcmp(a->id, b->id, sizeof(a->id));
 -}
 -
+ int git_oid_ncmp(const git_oid *oid_a, const git_oid *oid_b, size_t len)
  {
        const unsigned char *a = oid_a->id;
        const unsigned char *b = oid_b->id;
diff --cc src/reflog.c
Simple merge
diff --cc src/revparse.c
Simple merge
diff --cc src/status.c
Simple merge