rugged 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rugged/version.rb +1 -1
  3. data/vendor/libgit2/CMakeLists.txt +1 -1
  4. data/vendor/libgit2/cmake/FindLibSSH2.cmake +13 -0
  5. data/vendor/libgit2/include/git2/attr.h +7 -1
  6. data/vendor/libgit2/include/git2/blob.h +7 -1
  7. data/vendor/libgit2/include/git2/clone.h +1 -1
  8. data/vendor/libgit2/include/git2/common.h +19 -1
  9. data/vendor/libgit2/include/git2/deprecated.h +120 -0
  10. data/vendor/libgit2/include/git2/diff.h +3 -97
  11. data/vendor/libgit2/include/git2/email.h +127 -0
  12. data/vendor/libgit2/include/git2/filter.h +7 -1
  13. data/vendor/libgit2/include/git2/notes.h +2 -2
  14. data/vendor/libgit2/include/git2/oidarray.h +5 -8
  15. data/vendor/libgit2/include/git2/remote.h +4 -4
  16. data/vendor/libgit2/include/git2/repository.h +12 -10
  17. data/vendor/libgit2/include/git2/stash.h +1 -1
  18. data/vendor/libgit2/include/git2/stdint.h +3 -3
  19. data/vendor/libgit2/include/git2/sys/email.h +45 -0
  20. data/vendor/libgit2/include/git2/version.h +3 -3
  21. data/vendor/libgit2/include/git2.h +1 -0
  22. data/vendor/libgit2/src/CMakeLists.txt +7 -0
  23. data/vendor/libgit2/src/attr.c +24 -9
  24. data/vendor/libgit2/src/attr_file.c +23 -15
  25. data/vendor/libgit2/src/attr_file.h +3 -3
  26. data/vendor/libgit2/src/blame.c +4 -4
  27. data/vendor/libgit2/src/blame_git.c +1 -1
  28. data/vendor/libgit2/src/blob.c +15 -9
  29. data/vendor/libgit2/src/buffer.c +16 -8
  30. data/vendor/libgit2/src/buffer.h +2 -1
  31. data/vendor/libgit2/src/cc-compat.h +1 -7
  32. data/vendor/libgit2/src/checkout.c +6 -7
  33. data/vendor/libgit2/src/clone.c +1 -1
  34. data/vendor/libgit2/src/commit_graph.c +1 -1
  35. data/vendor/libgit2/src/config.c +1 -1
  36. data/vendor/libgit2/src/config_file.c +2 -2
  37. data/vendor/libgit2/src/config_parse.c +1 -1
  38. data/vendor/libgit2/src/describe.c +1 -1
  39. data/vendor/libgit2/src/diff.c +41 -173
  40. data/vendor/libgit2/src/email.c +299 -0
  41. data/vendor/libgit2/src/email.h +25 -0
  42. data/vendor/libgit2/src/filter.c +7 -1
  43. data/vendor/libgit2/src/hash/sha1/sha1dc/sha1.c +8 -8
  44. data/vendor/libgit2/src/ignore.c +2 -2
  45. data/vendor/libgit2/src/indexer.c +37 -3
  46. data/vendor/libgit2/src/libgit2.c +23 -0
  47. data/vendor/libgit2/src/merge.c +7 -4
  48. data/vendor/libgit2/src/notes.c +31 -31
  49. data/vendor/libgit2/src/oidarray.c +10 -1
  50. data/vendor/libgit2/src/path.c +1 -1
  51. data/vendor/libgit2/src/path.h +1 -1
  52. data/vendor/libgit2/src/pathspec.c +1 -1
  53. data/vendor/libgit2/src/refdb_fs.c +1 -1
  54. data/vendor/libgit2/src/refs.c +2 -2
  55. data/vendor/libgit2/src/refspec.c +1 -1
  56. data/vendor/libgit2/src/remote.c +12 -5
  57. data/vendor/libgit2/src/repository.c +130 -19
  58. data/vendor/libgit2/src/repository.h +4 -0
  59. data/vendor/libgit2/src/reset.c +1 -1
  60. data/vendor/libgit2/src/revparse.c +4 -4
  61. data/vendor/libgit2/src/stash.c +1 -1
  62. data/vendor/libgit2/src/streams/openssl_legacy.c +1 -1
  63. data/vendor/libgit2/src/streams/openssl_legacy.h +1 -1
  64. data/vendor/libgit2/src/threadstate.c +2 -1
  65. data/vendor/libgit2/src/trailer.c +1 -1
  66. data/vendor/libgit2/src/transports/ssh.c +4 -4
  67. data/vendor/libgit2/src/transports/winhttp.c +1 -1
  68. data/vendor/libgit2/src/util.c +1 -1
  69. data/vendor/libgit2/src/util.h +1 -1
  70. data/vendor/libgit2/src/win32/findfile.c +1 -1
  71. data/vendor/libgit2/src/win32/posix.h +6 -6
  72. data/vendor/libgit2/src/win32/posix_w32.c +9 -6
  73. metadata +11 -6
@@ -22,7 +22,7 @@
22
22
  int git_reset_default(
23
23
  git_repository *repo,
24
24
  const git_object *target,
25
- const git_strarray* pathspecs)
25
+ const git_strarray *pathspecs)
26
26
  {
27
27
  git_object *commit = NULL;
28
28
  git_tree *tree = NULL;
@@ -14,7 +14,7 @@
14
14
 
15
15
  #include "git2.h"
16
16
 
17
- static int maybe_sha_or_abbrev(git_object** out, git_repository *repo, const char *spec, size_t speclen)
17
+ static int maybe_sha_or_abbrev(git_object **out, git_repository *repo, const char *spec, size_t speclen)
18
18
  {
19
19
  git_oid oid;
20
20
 
@@ -24,7 +24,7 @@ static int maybe_sha_or_abbrev(git_object** out, git_repository *repo, const cha
24
24
  return git_object_lookup_prefix(out, repo, &oid, speclen, GIT_OBJECT_ANY);
25
25
  }
26
26
 
27
- static int maybe_sha(git_object** out, git_repository *repo, const char *spec)
27
+ static int maybe_sha(git_object **out, git_repository *repo, const char *spec)
28
28
  {
29
29
  size_t speclen = strlen(spec);
30
30
 
@@ -34,7 +34,7 @@ static int maybe_sha(git_object** out, git_repository *repo, const char *spec)
34
34
  return maybe_sha_or_abbrev(out, repo, spec, speclen);
35
35
  }
36
36
 
37
- static int maybe_abbrev(git_object** out, git_repository *repo, const char *spec)
37
+ static int maybe_abbrev(git_object **out, git_repository *repo, const char *spec)
38
38
  {
39
39
  size_t speclen = strlen(spec);
40
40
 
@@ -310,7 +310,7 @@ cleanup:
310
310
  return error;
311
311
  }
312
312
 
313
- static int handle_at_syntax(git_object **out, git_reference **ref, const char *spec, size_t identifier_len, git_repository* repo, const char *curly_braces_content)
313
+ static int handle_at_syntax(git_object **out, git_reference **ref, const char *spec, size_t identifier_len, git_repository *repo, const char *curly_braces_content)
314
314
  {
315
315
  bool is_numeric;
316
316
  int parsed = 0, error = -1;
@@ -56,7 +56,7 @@ static int append_abbreviated_oid(git_buf *out, const git_oid *b_commit)
56
56
  return git_buf_oom(out) ? -1 : 0;
57
57
  }
58
58
 
59
- static int append_commit_description(git_buf *out, git_commit* commit)
59
+ static int append_commit_description(git_buf *out, git_commit *commit)
60
60
  {
61
61
  const char *summary = git_commit_summary(commit);
62
62
  GIT_ERROR_CHECK_ALLOC(summary);
@@ -36,7 +36,7 @@ int OPENSSL_init_ssl__legacy(uint64_t opts, const void *settings)
36
36
  return 0;
37
37
  }
38
38
 
39
- BIO_METHOD* BIO_meth_new__legacy(int type, const char *name)
39
+ BIO_METHOD *BIO_meth_new__legacy(int type, const char *name)
40
40
  {
41
41
  BIO_METHOD *meth = git__calloc(1, sizeof(BIO_METHOD));
42
42
  if (!meth) {
@@ -42,7 +42,7 @@
42
42
  #if defined(GIT_OPENSSL_LEGACY) || defined(GIT_OPENSSL_DYNAMIC)
43
43
 
44
44
  extern int OPENSSL_init_ssl__legacy(uint64_t opts, const void *settings);
45
- extern BIO_METHOD* BIO_meth_new__legacy(int type, const char *name);
45
+ extern BIO_METHOD *BIO_meth_new__legacy(int type, const char *name);
46
46
  extern void BIO_meth_free__legacy(BIO_METHOD *biom);
47
47
  extern int BIO_meth_set_write__legacy(BIO_METHOD *biom, int (*write) (BIO *, const char *, int));
48
48
  extern int BIO_meth_set_read__legacy(BIO_METHOD *biom, int (*read) (BIO *, char *, int));
@@ -36,7 +36,8 @@ static void threadstate_dispose(git_threadstate *threadstate)
36
36
  if (!threadstate)
37
37
  return;
38
38
 
39
- git__free(threadstate->error_t.message);
39
+ if (threadstate->error_t.message != git_buf__initbuf)
40
+ git__free(threadstate->error_t.message);
40
41
  threadstate->error_t.message = NULL;
41
42
  }
42
43
 
@@ -258,7 +258,7 @@ static size_t find_trailer_end(const char *buf, size_t len)
258
258
  return len - ignore_non_trailer(buf, len);
259
259
  }
260
260
 
261
- static char *extract_trailer_block(const char *message, size_t* len)
261
+ static char *extract_trailer_block(const char *message, size_t *len)
262
262
  {
263
263
  size_t patch_start = find_patch_start(message);
264
264
  size_t trailer_end = find_trailer_end(message, patch_start);
@@ -476,11 +476,11 @@ static int request_creds(git_credential **out, ssh_subtransport *t, const char *
476
476
  }
477
477
 
478
478
  static int _git_ssh_session_create(
479
- LIBSSH2_SESSION** session,
479
+ LIBSSH2_SESSION **session,
480
480
  git_stream *io)
481
481
  {
482
482
  int rc = 0;
483
- LIBSSH2_SESSION* s;
483
+ LIBSSH2_SESSION *s;
484
484
  git_socket_stream *socket = GIT_CONTAINER_OF(io, git_socket_stream, parent);
485
485
 
486
486
  GIT_ASSERT_ARG(session);
@@ -521,8 +521,8 @@ static int _git_ssh_setup_conn(
521
521
  size_t i;
522
522
  ssh_stream *s;
523
523
  git_credential *cred = NULL;
524
- LIBSSH2_SESSION* session=NULL;
525
- LIBSSH2_CHANNEL* channel=NULL;
524
+ LIBSSH2_SESSION *session=NULL;
525
+ LIBSSH2_CHANNEL *channel=NULL;
526
526
 
527
527
  t->current_stream = NULL;
528
528
 
@@ -250,7 +250,7 @@ static int acquire_fallback_cred(
250
250
  hCoInitResult = CoInitializeEx(NULL, COINIT_MULTITHREADED);
251
251
 
252
252
  if (SUCCEEDED(hCoInitResult) || hCoInitResult == RPC_E_CHANGED_MODE) {
253
- IInternetSecurityManager* pISM;
253
+ IInternetSecurityManager *pISM;
254
254
 
255
255
  /* And if the target URI is in the My Computer, Intranet, or Trusted zones */
256
256
  if (SUCCEEDED(CoCreateInstance(&CLSID_InternetSecurityManager, NULL,
@@ -755,7 +755,7 @@ int git__getenv(git_buf *out, const char *name)
755
755
 
756
756
  if (value_len)
757
757
  error = git_buf_put_w(out, wide_value, value_len);
758
- else if (GetLastError() == ERROR_ENVVAR_NOT_FOUND)
758
+ else if (GetLastError() == ERROR_SUCCESS || GetLastError() == ERROR_ENVVAR_NOT_FOUND)
759
759
  error = GIT_ENOTFOUND;
760
760
  else
761
761
  git_error_set(GIT_ERROR_OS, "could not read environment variable '%s'", name);
@@ -34,7 +34,7 @@
34
34
  # define GIT_CONTAINER_OF(ptr, type, member) \
35
35
  __builtin_choose_expr( \
36
36
  __builtin_offsetof(type, member) == 0 && \
37
- __builtin_types_compatible_p(typeof(&((type *) 0)->member), typeof(ptr)), \
37
+ __builtin_types_compatible_p(__typeof__(&((type *) 0)->member), __typeof__(ptr)), \
38
38
  ((type *) (ptr)), \
39
39
  (void)0)
40
40
  #else
@@ -49,7 +49,7 @@ static int win32_path_to_8(git_buf *dest, const wchar_t *src)
49
49
  return git_buf_sets(dest, utf8_path);
50
50
  }
51
51
 
52
- static wchar_t* win32_walkpath(wchar_t *path, wchar_t *buf, size_t buflen)
52
+ static wchar_t *win32_walkpath(wchar_t *path, wchar_t *buf, size_t buflen)
53
53
  {
54
54
  wchar_t term, *base = path;
55
55
 
@@ -23,7 +23,7 @@ typedef SOCKET GIT_SOCKET;
23
23
 
24
24
  extern int p_fstat(int fd, struct stat *buf);
25
25
  extern int p_lstat(const char *file_name, struct stat *buf);
26
- extern int p_stat(const char* path, struct stat *buf);
26
+ extern int p_stat(const char *path, struct stat *buf);
27
27
 
28
28
  extern int p_utimes(const char *filename, const struct p_timeval times[2]);
29
29
  extern int p_futimes(int fd, const struct p_timeval times[2]);
@@ -38,15 +38,15 @@ extern char *p_realpath(const char *orig_path, char *buffer);
38
38
 
39
39
  extern int p_recv(GIT_SOCKET socket, void *buffer, size_t length, int flags);
40
40
  extern int p_send(GIT_SOCKET socket, const void *buffer, size_t length, int flags);
41
- extern int p_inet_pton(int af, const char* src, void* dst);
41
+ extern int p_inet_pton(int af, const char *src, void* dst);
42
42
 
43
43
  extern int p_vsnprintf(char *buffer, size_t count, const char *format, va_list argptr);
44
44
  extern int p_snprintf(char *buffer, size_t count, const char *format, ...) GIT_FORMAT_PRINTF(3, 4);
45
45
  extern int p_mkstemp(char *tmp_path);
46
- extern int p_chdir(const char* path);
47
- extern int p_chmod(const char* path, mode_t mode);
48
- extern int p_rmdir(const char* path);
49
- extern int p_access(const char* path, mode_t mode);
46
+ extern int p_chdir(const char *path);
47
+ extern int p_chmod(const char *path, mode_t mode);
48
+ extern int p_rmdir(const char *path);
49
+ extern int p_access(const char *path, mode_t mode);
50
50
  extern int p_ftruncate(int fd, off64_t size);
51
51
 
52
52
  /* p_lstat is almost but not quite POSIX correct. Specifically, the use of
@@ -648,6 +648,8 @@ int p_getcwd(char *buffer_out, size_t size)
648
648
  if (!cwd)
649
649
  return -1;
650
650
 
651
+ git_win32_path_remove_namespace(cwd, wcslen(cwd));
652
+
651
653
  /* Convert the working directory back to UTF-8 */
652
654
  if (git__utf16_to_8(buffer_out, size, cwd) < 0) {
653
655
  DWORD code = GetLastError();
@@ -660,6 +662,7 @@ int p_getcwd(char *buffer_out, size_t size)
660
662
  return -1;
661
663
  }
662
664
 
665
+ git_path_mkposix(buffer_out);
663
666
  return 0;
664
667
  }
665
668
 
@@ -690,7 +693,7 @@ static int getfinalpath_w(
690
693
  return (int)git_win32_path_remove_namespace(dest, dwChars);
691
694
  }
692
695
 
693
- static int follow_and_lstat_link(git_win32_path path, struct stat* buf)
696
+ static int follow_and_lstat_link(git_win32_path path, struct stat *buf)
694
697
  {
695
698
  git_win32_path target_w;
696
699
 
@@ -716,7 +719,7 @@ int p_fstat(int fd, struct stat *buf)
716
719
  return 0;
717
720
  }
718
721
 
719
- int p_stat(const char* path, struct stat* buf)
722
+ int p_stat(const char *path, struct stat *buf)
720
723
  {
721
724
  git_win32_path path_w;
722
725
  int len;
@@ -733,7 +736,7 @@ int p_stat(const char* path, struct stat* buf)
733
736
  return 0;
734
737
  }
735
738
 
736
- int p_chdir(const char* path)
739
+ int p_chdir(const char *path)
737
740
  {
738
741
  git_win32_path buf;
739
742
 
@@ -743,7 +746,7 @@ int p_chdir(const char* path)
743
746
  return _wchdir(buf);
744
747
  }
745
748
 
746
- int p_chmod(const char* path, mode_t mode)
749
+ int p_chmod(const char *path, mode_t mode)
747
750
  {
748
751
  git_win32_path buf;
749
752
 
@@ -753,7 +756,7 @@ int p_chmod(const char* path, mode_t mode)
753
756
  return _wchmod(buf, mode);
754
757
  }
755
758
 
756
- int p_rmdir(const char* path)
759
+ int p_rmdir(const char *path)
757
760
  {
758
761
  git_win32_path buf;
759
762
  int error;
@@ -873,7 +876,7 @@ int p_mkstemp(char *tmp_path)
873
876
  return p_open(tmp_path, O_RDWR | O_CREAT | O_EXCL, 0744); /* -V536 */
874
877
  }
875
878
 
876
- int p_access(const char* path, mode_t mode)
879
+ int p_access(const char *path, mode_t mode)
877
880
  {
878
881
  git_win32_path buf;
879
882
 
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rugged
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Chacon
8
8
  - Vicent Marti
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-09-06 00:00:00.000000000 Z
12
+ date: 2021-12-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake-compiler
@@ -130,6 +130,7 @@ files:
130
130
  - vendor/libgit2/cmake/FindGSSFramework.cmake
131
131
  - vendor/libgit2/cmake/FindHTTP_Parser.cmake
132
132
  - vendor/libgit2/cmake/FindIconv.cmake
133
+ - vendor/libgit2/cmake/FindLibSSH2.cmake
133
134
  - vendor/libgit2/cmake/FindPCRE.cmake
134
135
  - vendor/libgit2/cmake/FindPCRE2.cmake
135
136
  - vendor/libgit2/cmake/FindPkgLibraries.cmake
@@ -253,6 +254,7 @@ files:
253
254
  - vendor/libgit2/include/git2/deprecated.h
254
255
  - vendor/libgit2/include/git2/describe.h
255
256
  - vendor/libgit2/include/git2/diff.h
257
+ - vendor/libgit2/include/git2/email.h
256
258
  - vendor/libgit2/include/git2/errors.h
257
259
  - vendor/libgit2/include/git2/filter.h
258
260
  - vendor/libgit2/include/git2/global.h
@@ -298,6 +300,7 @@ files:
298
300
  - vendor/libgit2/include/git2/sys/cred.h
299
301
  - vendor/libgit2/include/git2/sys/credential.h
300
302
  - vendor/libgit2/include/git2/sys/diff.h
303
+ - vendor/libgit2/include/git2/sys/email.h
301
304
  - vendor/libgit2/include/git2/sys/filter.h
302
305
  - vendor/libgit2/include/git2/sys/hashsig.h
303
306
  - vendor/libgit2/include/git2/sys/index.h
@@ -400,6 +403,8 @@ files:
400
403
  - vendor/libgit2/src/diff_tform.h
401
404
  - vendor/libgit2/src/diff_xdiff.c
402
405
  - vendor/libgit2/src/diff_xdiff.h
406
+ - vendor/libgit2/src/email.c
407
+ - vendor/libgit2/src/email.h
403
408
  - vendor/libgit2/src/errors.c
404
409
  - vendor/libgit2/src/errors.h
405
410
  - vendor/libgit2/src/features.h.in
@@ -677,7 +682,7 @@ licenses:
677
682
  - MIT
678
683
  metadata:
679
684
  msys2_mingw_dependencies: libssh2 cmake
680
- post_install_message:
685
+ post_install_message:
681
686
  rdoc_options: []
682
687
  require_paths:
683
688
  - lib
@@ -692,8 +697,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
692
697
  - !ruby/object:Gem::Version
693
698
  version: '0'
694
699
  requirements: []
695
- rubygems_version: 3.1.2
696
- signing_key:
700
+ rubygems_version: 3.2.3
701
+ signing_key:
697
702
  specification_version: 4
698
703
  summary: Rugged is a Ruby binding to the libgit2 linkable library
699
704
  test_files: []