rugged 0.23.2 → 0.23.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rugged/version.rb +1 -1
  3. data/vendor/libgit2/CMakeLists.txt +12 -3
  4. data/vendor/libgit2/COPYING +46 -0
  5. data/vendor/libgit2/include/git2/config.h +4 -2
  6. data/vendor/libgit2/include/git2/cred_helpers.h +1 -1
  7. data/vendor/libgit2/include/git2/diff.h +0 -19
  8. data/vendor/libgit2/include/git2/errors.h +12 -0
  9. data/vendor/libgit2/include/git2/sys/filter.h +1 -4
  10. data/vendor/libgit2/include/git2/sys/refdb_backend.h +2 -3
  11. data/vendor/libgit2/include/git2/transport.h +21 -14
  12. data/vendor/libgit2/include/git2/version.h +2 -2
  13. data/vendor/libgit2/src/blame.c +1 -1
  14. data/vendor/libgit2/src/blame_git.c +27 -7
  15. data/vendor/libgit2/src/blame_git.h +1 -1
  16. data/vendor/libgit2/src/branch.c +12 -1
  17. data/vendor/libgit2/src/checkout.c +2 -1
  18. data/vendor/libgit2/src/clone.c +2 -2
  19. data/vendor/libgit2/src/common.h +13 -13
  20. data/vendor/libgit2/src/curl_stream.c +8 -7
  21. data/vendor/libgit2/src/diff.c +0 -25
  22. data/vendor/libgit2/src/diff_driver.c +6 -7
  23. data/vendor/libgit2/src/diff_patch.c +4 -0
  24. data/vendor/libgit2/src/diff_xdiff.c +7 -0
  25. data/vendor/libgit2/src/diff_xdiff.h +5 -0
  26. data/vendor/libgit2/src/errors.c +40 -75
  27. data/vendor/libgit2/src/filter.c +2 -5
  28. data/vendor/libgit2/src/global.c +9 -25
  29. data/vendor/libgit2/src/global.h +0 -1
  30. data/vendor/libgit2/src/index.c +3 -3
  31. data/vendor/libgit2/src/iterator.c +2 -2
  32. data/vendor/libgit2/src/merge.c +0 -56
  33. data/vendor/libgit2/src/merge_file.c +76 -22
  34. data/vendor/libgit2/src/openssl_stream.c +2 -3
  35. data/vendor/libgit2/src/path.c +0 -16
  36. data/vendor/libgit2/src/path.h +0 -5
  37. data/vendor/libgit2/src/refdb_fs.c +0 -7
  38. data/vendor/libgit2/src/remote.c +9 -18
  39. data/vendor/libgit2/src/stransport_stream.c +1 -1
  40. data/vendor/libgit2/src/submodule.c +7 -3
  41. data/vendor/libgit2/src/sysdir.c +8 -22
  42. data/vendor/libgit2/src/transports/http.c +9 -1
  43. data/vendor/libgit2/src/transports/smart_protocol.c +1 -1
  44. data/vendor/libgit2/src/transports/ssh.c +2 -2
  45. data/vendor/libgit2/src/transports/winhttp.c +1 -1
  46. data/vendor/libgit2/src/util.c +0 -48
  47. data/vendor/libgit2/src/util.h +5 -13
  48. data/vendor/libgit2/src/win32/posix_w32.c +0 -2
  49. data/vendor/libgit2/src/xdiff/xdiff.h +5 -3
  50. data/vendor/libgit2/src/xdiff/xdiffi.c +8 -4
  51. data/vendor/libgit2/src/xdiff/xhistogram.c +4 -2
  52. data/vendor/libgit2/src/xdiff/xmerge.c +98 -44
  53. metadata +76 -81
  54. data/vendor/libgit2/src/merge_file.h +0 -14
  55. data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.c +0 -343
  56. data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h +0 -93
  57. data/vendor/libgit2/src/win32/w32_stack.c +0 -192
  58. data/vendor/libgit2/src/win32/w32_stack.h +0 -138
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c8a9803d3706b67799a0f51ef3d2f92ad722510
4
- data.tar.gz: 48c5339cad9977aec187c1d5b5527ef81fe1d072
3
+ metadata.gz: 4df2826e70f1fb3fb4b440f2fc459b0d9fca6511
4
+ data.tar.gz: 69765b8342fc60b5e78244b6bd5316c4d2f0d8bc
5
5
  SHA512:
6
- metadata.gz: 9cb10510ef6d1a4441c90a743237c36583f6c867a5560fb172a79123ede5f162632b03caa64fe1be24bc23041e4ee0732f8785e105629ff271e01ad29b31c23a
7
- data.tar.gz: 89dfecb8124b9e3817e36970fac8de796c216580b3b251dba7ec1844545ecd74703e8cf483f130a2e4112ff3c132a2e3c30c1073f876d216ffd8b8e46977f801
6
+ metadata.gz: 981a484bf2d8fe7d7aa706304980809be6fdd2b179bbd8c01832bb7f8eac485487cfd1a608d104b798079169012d78738ded561824301278830b14846f70dc14
7
+ data.tar.gz: c4d7f8b3670e499c6878586d4aa1564e8e2cbde7ebaf72e4548bc3be0ea4897231227a852645243f1cdd3a79154f5fc3fe47c334a85f25495ec08607bf648f34
@@ -1,3 +1,3 @@
1
1
  module Rugged
2
- Version = VERSION = '0.23.2'
2
+ Version = VERSION = '0.23.3'
3
3
  end
@@ -152,8 +152,18 @@ STRING(REGEX REPLACE "^.*LIBGIT2_SOVERSION ([0-9]+)$" "\\1" LIBGIT2_SOVERSION "$
152
152
  INCLUDE_DIRECTORIES(src include)
153
153
 
154
154
  IF (SECURITY_FOUND)
155
- MESSAGE("-- Found Security ${SECURITY_DIRS}")
156
- LIST(APPEND LIBGIT2_PC_LIBS "-framework Security")
155
+ # OS X 10.7 and older do not have some functions we use, fall back to OpenSSL there
156
+ CHECK_LIBRARY_EXISTS("${SECURITY_DIRS}" SSLCreateContext "Security/SecureTransport.h" HAVE_NEWER_SECURITY)
157
+ IF (HAVE_NEWER_SECURITY)
158
+ MESSAGE("-- Found Security ${SECURITY_DIRS}")
159
+ LIST(APPEND LIBGIT2_PC_LIBS "-framework Security")
160
+ ELSE()
161
+ MESSAGE("-- Security framework is too old, falling back to OpenSSL")
162
+ SET(SECURITY_FOUND "NO")
163
+ SET(SECURITY_DIRS "")
164
+ SET(SECURITY_DIR "")
165
+ SET(USE_OPENSSL "ON")
166
+ ENDIF()
157
167
  ENDIF()
158
168
 
159
169
  IF (COREFOUNDATION_FOUND)
@@ -336,7 +346,6 @@ IF (MSVC)
336
346
 
337
347
  IF (MSVC_CRTDBG)
338
348
  SET(CRT_FLAG_DEBUG "${CRT_FLAG_DEBUG} /DGIT_MSVC_CRTDBG")
339
- SET(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES}" "Dbghelp.lib")
340
349
  ENDIF()
341
350
 
342
351
  # /Zi - Create debugging information
@@ -407,6 +407,52 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
407
407
  ----------------------------------------------------------------------
408
408
 
409
409
  The regex library (deps/regex/) is licensed under the GNU LGPL
410
+ (available at the end of this file).
411
+
412
+ Definitions for data structures and routines for the regular
413
+ expression library.
414
+
415
+ Copyright (C) 1985,1989-93,1995-98,2000,2001,2002,2003,2005,2006,2008
416
+ Free Software Foundation, Inc.
417
+ This file is part of the GNU C Library.
418
+
419
+ The GNU C Library is free software; you can redistribute it and/or
420
+ modify it under the terms of the GNU Lesser General Public
421
+ License as published by the Free Software Foundation; either
422
+ version 2.1 of the License, or (at your option) any later version.
423
+
424
+ The GNU C Library is distributed in the hope that it will be useful,
425
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
426
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
427
+ Lesser General Public License for more details.
428
+
429
+ You should have received a copy of the GNU Lesser General Public
430
+ License along with the GNU C Library; if not, write to the Free
431
+ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
432
+ 02110-1301 USA.
433
+
434
+ ----------------------------------------------------------------------
435
+
436
+ The bundled winhttp definition files (deps/winhttp/) are licensed under
437
+ the GNU LGPL (available at the end of this file).
438
+
439
+ Copyright (C) 2007 Francois Gouget
440
+
441
+ This library is free software; you can redistribute it and/or
442
+ modify it under the terms of the GNU Lesser General Public
443
+ License as published by the Free Software Foundation; either
444
+ version 2.1 of the License, or (at your option) any later version.
445
+
446
+ This library is distributed in the hope that it will be useful,
447
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
448
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
449
+ Lesser General Public License for more details.
450
+
451
+ You should have received a copy of the GNU Lesser General Public
452
+ License along with this library; if not, write to the Free Software
453
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
454
+
455
+ ----------------------------------------------------------------------
410
456
 
411
457
  GNU LESSER GENERAL PUBLIC LICENSE
412
458
  Version 2.1, February 1999
@@ -171,6 +171,9 @@ GIT_EXTERN(int) git_config_new(git_config **out);
171
171
  * parsed; it's expected to be a native Git config file following
172
172
  * the default Git config syntax (see man git-config).
173
173
  *
174
+ * If the file does not exist, the file will still be added and it
175
+ * will be created the first time we write to it.
176
+ *
174
177
  * Note that the configuration object will free the file
175
178
  * automatically.
176
179
  *
@@ -202,8 +205,7 @@ GIT_EXTERN(int) git_config_add_file_ondisk(
202
205
  *
203
206
  * @param out The configuration instance to create
204
207
  * @param path Path to the on-disk file to open
205
- * @return 0 on success, GIT_ENOTFOUND when the file doesn't exist
206
- * or an error code
208
+ * @return 0 on success, or an error code
207
209
  */
208
210
  GIT_EXTERN(int) git_config_open_ondisk(git_config **out, const char *path);
209
211
 
@@ -34,7 +34,7 @@ typedef struct git_cred_userpass_payload {
34
34
  *
35
35
  * @param cred The newly created credential object.
36
36
  * @param url The resource for which we are demanding a credential.
37
- * @param user_from_url The username that was embedded in a "user@host"
37
+ * @param user_from_url The username that was embedded in a "user\@host"
38
38
  * remote url, or NULL if not included.
39
39
  * @param allowed_types A bitmask stating which cred types are OK to return.
40
40
  * @param payload The payload provided when specifying this callback. (This is
@@ -835,25 +835,6 @@ GIT_EXTERN(int) git_diff_tree_to_workdir_with_index(
835
835
  git_tree *old_tree,
836
836
  const git_diff_options *opts); /**< can be NULL for defaults */
837
837
 
838
- /**
839
- * Create a diff with the difference between two index objects.
840
- *
841
- * The first index will be used for the "old_file" side of the delta and the
842
- * second index will be used for the "new_file" side of the delta.
843
- *
844
- * @param diff Output pointer to a git_diff pointer to be allocated.
845
- * @param repo The repository containing the indexes.
846
- * @param old_index A git_index object to diff from.
847
- * @param new_index A git_index object to diff to.
848
- * @param opts Structure with options to influence diff or NULL for defaults.
849
- */
850
- GIT_EXTERN(int) git_diff_index_to_index(
851
- git_diff **diff,
852
- git_repository *repo,
853
- git_index *old_index,
854
- git_index *new_index,
855
- const git_diff_options *opts); /**< can be NULL for defaults */
856
-
857
838
  /**
858
839
  * Merge one diff into another.
859
840
  *
@@ -113,6 +113,18 @@ GIT_EXTERN(const git_error *) giterr_last(void);
113
113
  */
114
114
  GIT_EXTERN(void) giterr_clear(void);
115
115
 
116
+ /**
117
+ * Get the last error data and clear it.
118
+ *
119
+ * This copies the last error into the given `git_error` struct
120
+ * and returns 0 if the copy was successful, leaving the error
121
+ * cleared as if `giterr_clear` had been called.
122
+ *
123
+ * If there was no existing error in the library, -1 will be returned
124
+ * and the contents of `cpy` will be left unmodified.
125
+ */
126
+ GIT_EXTERN(int) giterr_detach(git_error *cpy);
127
+
116
128
  /**
117
129
  * Set the error message string for this thread.
118
130
  *
@@ -240,10 +240,7 @@ typedef void (*git_filter_cleanup_fn)(
240
240
  * for this filter (e.g. "eol crlf text"). If the attribute name is bare,
241
241
  * it will be simply loaded and passed to the `check` callback. If it has
242
242
  * a value (i.e. "name=value"), the attribute must match that value for
243
- * the filter to be applied. The value may be a wildcard (eg, "name=*"),
244
- * in which case the filter will be invoked for any value for the given
245
- * attribute name. See the attribute parameter of the `check` callback
246
- * for the attribute value that was specified.
243
+ * the filter to be applied.
247
244
  *
248
245
  * The `initialize`, `shutdown`, `check`, `apply`, and `cleanup` callbacks
249
246
  * are all documented above with the respective function pointer typedefs.
@@ -103,9 +103,8 @@ struct git_refdb_backend {
103
103
  const git_signature *who, const char *message);
104
104
 
105
105
  /**
106
- * Deletes the given reference (and if necessary its reflog)
107
- * from the refdb. A refdb implementation must provide this
108
- * function.
106
+ * Deletes the given reference from the refdb. A refdb implementation
107
+ * must provide this function.
109
108
  */
110
109
  int (*del)(git_refdb_backend *backend, const char *ref_name, const git_oid *old_id, const char *old_target);
111
110
 
@@ -37,32 +37,39 @@ typedef enum {
37
37
  * Hostkey information taken from libssh2
38
38
  */
39
39
  typedef struct {
40
- git_cert parent;
41
-
42
40
  /**
43
- * A hostkey type from libssh2, either
44
- * `GIT_CERT_SSH_MD5` or `GIT_CERT_SSH_SHA1`
41
+ * Type of certificate. Here to share the header with
42
+ * `git_cert`.
45
43
  */
44
+ git_cert_t cert_type;
45
+ /**
46
+ * A hostkey type from libssh2, either
47
+ * `GIT_CERT_SSH_MD5` or `GIT_CERT_SSH_SHA1`
48
+ */
46
49
  git_cert_ssh_t type;
47
50
 
48
- /**
49
- * Hostkey hash. If type has `GIT_CERT_SSH_MD5` set, this will
50
- * have the MD5 hash of the hostkey.
51
- */
51
+ /**
52
+ * Hostkey hash. If type has `GIT_CERT_SSH_MD5` set, this will
53
+ * have the MD5 hash of the hostkey.
54
+ */
52
55
  unsigned char hash_md5[16];
53
56
 
54
- /**
55
- * Hostkey hash. If type has `GIT_CERT_SSH_SHA1` set, this will
56
- * have the SHA-1 hash of the hostkey.
57
- */
58
- unsigned char hash_sha1[20];
57
+ /**
58
+ * Hostkey hash. If type has `GIT_CERT_SSH_SHA1` set, this will
59
+ * have the SHA-1 hash of the hostkey.
60
+ */
61
+ unsigned char hash_sha1[20];
59
62
  } git_cert_hostkey;
60
63
 
61
64
  /**
62
65
  * X.509 certificate information
63
66
  */
64
67
  typedef struct {
65
- git_cert parent;
68
+ /**
69
+ * Type of certificate. Here to share the header with
70
+ * `git_cert`.
71
+ */
72
+ git_cert_t cert_type;
66
73
  /**
67
74
  * Pointer to the X.509 certificate data
68
75
  */
@@ -7,10 +7,10 @@
7
7
  #ifndef INCLUDE_git_version_h__
8
8
  #define INCLUDE_git_version_h__
9
9
 
10
- #define LIBGIT2_VERSION "0.23.0"
10
+ #define LIBGIT2_VERSION "0.23.3"
11
11
  #define LIBGIT2_VER_MAJOR 0
12
12
  #define LIBGIT2_VER_MINOR 23
13
- #define LIBGIT2_VER_REVISION 0
13
+ #define LIBGIT2_VER_REVISION 3
14
14
  #define LIBGIT2_VER_PATCH 0
15
15
 
16
16
  #define LIBGIT2_SOVERSION 23
@@ -331,7 +331,7 @@ static int blame_internal(git_blame *blame)
331
331
 
332
332
  blame->ent = ent;
333
333
 
334
- git_blame__like_git(blame, blame->options.flags);
334
+ error = git_blame__like_git(blame, blame->options.flags);
335
335
 
336
336
  cleanup:
337
337
  for (ent = blame->ent; ent; ) {
@@ -9,6 +9,7 @@
9
9
  #include "commit.h"
10
10
  #include "blob.h"
11
11
  #include "xdiff/xinclude.h"
12
+ #include "diff_xdiff.h"
12
13
 
13
14
  /*
14
15
  * Origin is refcounted and usually we keep the blob contents to be
@@ -351,6 +352,13 @@ static int diff_hunks(mmfile_t file_a, mmfile_t file_b, void *cb_data)
351
352
  ecb.priv = cb_data;
352
353
 
353
354
  trim_common_tail(&file_a, &file_b, 0);
355
+
356
+ if (file_a.size > GIT_XDIFF_MAX_SIZE ||
357
+ file_b.size > GIT_XDIFF_MAX_SIZE) {
358
+ giterr_set(GITERR_INVALID, "file too large to blame");
359
+ return -1;
360
+ }
361
+
354
362
  return xdl_diff(&file_a, &file_b, &xpp, &xecfg, &ecb);
355
363
  }
356
364
 
@@ -379,7 +387,9 @@ static int pass_blame_to_parent(
379
387
  fill_origin_blob(parent, &file_p);
380
388
  fill_origin_blob(target, &file_o);
381
389
 
382
- diff_hunks(file_p, file_o, &d);
390
+ if (diff_hunks(file_p, file_o, &d) < 0)
391
+ return -1;
392
+
383
393
  /* The reset (i.e. anything after tlno) are the same as the parent */
384
394
  blame_chunk(blame, d.tlno, d.plno, last_in_target, target, parent);
385
395
 
@@ -477,12 +487,13 @@ static void pass_whole_blame(git_blame *blame,
477
487
  }
478
488
  }
479
489
 
480
- static void pass_blame(git_blame *blame, git_blame__origin *origin, uint32_t opt)
490
+ static int pass_blame(git_blame *blame, git_blame__origin *origin, uint32_t opt)
481
491
  {
482
492
  git_commit *commit = origin->commit;
483
493
  int i, num_parents;
484
494
  git_blame__origin *sg_buf[16];
485
495
  git_blame__origin *porigin, **sg_origin = sg_buf;
496
+ int ret, error = 0;
486
497
 
487
498
  num_parents = git_commit_parentcount(commit);
488
499
  if (!git_oid_cmp(git_commit_id(commit), &blame->options.oldest_commit))
@@ -540,8 +551,13 @@ static void pass_blame(git_blame *blame, git_blame__origin *origin, uint32_t opt
540
551
  origin_incref(porigin);
541
552
  origin->previous = porigin;
542
553
  }
543
- if (pass_blame_to_parent(blame, origin, porigin))
554
+
555
+ if ((ret = pass_blame_to_parent(blame, origin, porigin)) != 0) {
556
+ if (ret < 0)
557
+ error = -1;
558
+
544
559
  goto finish;
560
+ }
545
561
  }
546
562
 
547
563
  /* TODO: optionally find moves in parents' files */
@@ -554,7 +570,7 @@ finish:
554
570
  origin_decref(sg_origin[i]);
555
571
  if (sg_origin != sg_buf)
556
572
  git__free(sg_origin);
557
- return;
573
+ return error;
558
574
  }
559
575
 
560
576
  /*
@@ -583,7 +599,7 @@ static void coalesce(git_blame *blame)
583
599
  }
584
600
  }
585
601
 
586
- void git_blame__like_git(git_blame *blame, uint32_t opt)
602
+ int git_blame__like_git(git_blame *blame, uint32_t opt)
587
603
  {
588
604
  while (true) {
589
605
  git_blame__entry *ent;
@@ -594,11 +610,13 @@ void git_blame__like_git(git_blame *blame, uint32_t opt)
594
610
  if (!ent->guilty)
595
611
  suspect = ent->suspect;
596
612
  if (!suspect)
597
- return; /* all done */
613
+ return 0; /* all done */
598
614
 
599
615
  /* We'll use this suspect later in the loop, so hold on to it for now. */
600
616
  origin_incref(suspect);
601
- pass_blame(blame, suspect, opt);
617
+
618
+ if (pass_blame(blame, suspect, opt) < 0)
619
+ return -1;
602
620
 
603
621
  /* Take responsibility for the remaining entries */
604
622
  for (ent = blame->ent; ent; ent = ent->next) {
@@ -613,6 +631,8 @@ void git_blame__like_git(git_blame *blame, uint32_t opt)
613
631
  }
614
632
 
615
633
  coalesce(blame);
634
+
635
+ return 0;
616
636
  }
617
637
 
618
638
  void git_blame__free_entry(git_blame__entry *ent)
@@ -15,6 +15,6 @@ int git_blame__get_origin(
15
15
  git_commit *commit,
16
16
  const char *path);
17
17
  void git_blame__free_entry(git_blame__entry *ent);
18
- void git_blame__like_git(git_blame *sb, uint32_t flags);
18
+ int git_blame__like_git(git_blame *sb, uint32_t flags);
19
19
 
20
20
  #endif
@@ -155,7 +155,18 @@ int git_branch_delete(git_reference *branch)
155
155
  git_reference_owner(branch), git_buf_cstr(&config_section), NULL) < 0)
156
156
  goto on_error;
157
157
 
158
- error = git_reference_delete(branch);
158
+ if (git_reference_delete(branch) < 0)
159
+ goto on_error;
160
+
161
+ if ((error = git_reflog_delete(git_reference_owner(branch), git_reference_name(branch))) < 0) {
162
+ if (error == GIT_ENOTFOUND) {
163
+ giterr_clear();
164
+ error = 0;
165
+ }
166
+ goto on_error;
167
+ }
168
+
169
+ error = 0;
159
170
 
160
171
  on_error:
161
172
  git_buf_free(&config_section);
@@ -18,6 +18,7 @@
18
18
  #include "git2/submodule.h"
19
19
  #include "git2/sys/index.h"
20
20
  #include "git2/sys/filter.h"
21
+ #include "git2/merge.h"
21
22
 
22
23
  #include "refs.h"
23
24
  #include "repository.h"
@@ -27,7 +28,7 @@
27
28
  #include "diff.h"
28
29
  #include "pathspec.h"
29
30
  #include "buf_text.h"
30
- #include "merge_file.h"
31
+ #include "diff_xdiff.h"
31
32
  #include "path.h"
32
33
  #include "attr.h"
33
34
  #include "pool.h"
@@ -440,14 +440,14 @@ int git_clone(
440
440
 
441
441
  if (error != 0) {
442
442
  git_error_state last_error = {0};
443
- giterr_state_capture(&last_error, error);
443
+ giterr_capture(&last_error, error);
444
444
 
445
445
  git_repository_free(repo);
446
446
  repo = NULL;
447
447
 
448
448
  (void)git_futils_rmdir_r(local_path, NULL, rmdir_flags);
449
449
 
450
- giterr_state_restore(&last_error);
450
+ giterr_restore(&last_error);
451
451
  }
452
452
 
453
453
  *out = repo;