rugged 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) 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/deps/ntlmclient/CMakeLists.txt +1 -0
  5. data/vendor/libgit2/deps/ntlmclient/compat.h +0 -34
  6. data/vendor/libgit2/deps/ntlmclient/crypt_openssl.c +1 -1
  7. data/vendor/libgit2/deps/ntlmclient/ntlm.c +5 -5
  8. data/vendor/libgit2/deps/ntlmclient/util.c +15 -1
  9. data/vendor/libgit2/deps/ntlmclient/util.h +2 -1
  10. data/vendor/libgit2/include/git2/apply.h +2 -0
  11. data/vendor/libgit2/include/git2/blob.h +17 -1
  12. data/vendor/libgit2/include/git2/common.h +5 -0
  13. data/vendor/libgit2/include/git2/config.h +1 -1
  14. data/vendor/libgit2/include/git2/diff.h +1 -1
  15. data/vendor/libgit2/include/git2/index.h +2 -2
  16. data/vendor/libgit2/include/git2/indexer.h +2 -1
  17. data/vendor/libgit2/include/git2/odb.h +15 -20
  18. data/vendor/libgit2/include/git2/refs.h +3 -3
  19. data/vendor/libgit2/include/git2/repository.h +95 -52
  20. data/vendor/libgit2/include/git2/transport.h +1 -1
  21. data/vendor/libgit2/include/git2/tree.h +2 -0
  22. data/vendor/libgit2/include/git2/version.h +2 -2
  23. data/vendor/libgit2/src/blame.c +15 -10
  24. data/vendor/libgit2/src/blob.c +9 -0
  25. data/vendor/libgit2/src/clone.c +42 -21
  26. data/vendor/libgit2/src/config_cache.c +6 -3
  27. data/vendor/libgit2/src/diff_tform.c +2 -2
  28. data/vendor/libgit2/src/index.c +6 -5
  29. data/vendor/libgit2/src/indexer.c +19 -3
  30. data/vendor/libgit2/src/integer.h +15 -0
  31. data/vendor/libgit2/src/merge.c +5 -2
  32. data/vendor/libgit2/src/mwindow.c +3 -1
  33. data/vendor/libgit2/src/odb.c +4 -3
  34. data/vendor/libgit2/src/pack.c +10 -6
  35. data/vendor/libgit2/src/posix.c +32 -9
  36. data/vendor/libgit2/src/posix.h +9 -0
  37. data/vendor/libgit2/src/refdb_fs.c +4 -2
  38. data/vendor/libgit2/src/refs.c +20 -7
  39. data/vendor/libgit2/src/refs.h +1 -1
  40. data/vendor/libgit2/src/refspec.c +48 -32
  41. data/vendor/libgit2/src/remote.c +13 -7
  42. data/vendor/libgit2/src/repository.c +15 -15
  43. data/vendor/libgit2/src/repository.h +1 -1
  44. data/vendor/libgit2/src/thread-utils.h +24 -19
  45. data/vendor/libgit2/src/transports/httpclient.c +9 -4
  46. data/vendor/libgit2/src/transports/winhttp.c +99 -52
  47. data/vendor/libgit2/src/unix/posix.h +3 -0
  48. data/vendor/libgit2/src/win32/posix_w32.c +70 -0
  49. data/vendor/libgit2/src/worktree.c +8 -1
  50. metadata +2 -2
@@ -101,4 +101,7 @@ GIT_INLINE(int) p_futimes(int f, const struct p_timeval t[2])
101
101
  # define p_futimes futimes
102
102
  #endif
103
103
 
104
+ #define p_pread(f, d, s, o) pread(f, d, s, o)
105
+ #define p_pwrite(f, d, s, o) pwrite(f, d, s, o)
106
+
104
107
  #endif
@@ -982,3 +982,73 @@ int p_inet_pton(int af, const char *src, void *dst)
982
982
  errno = EINVAL;
983
983
  return -1;
984
984
  }
985
+
986
+ ssize_t p_pread(int fd, void *data, size_t size, off64_t offset)
987
+ {
988
+ HANDLE fh;
989
+ DWORD rsize = 0;
990
+ OVERLAPPED ov = {0};
991
+ LARGE_INTEGER pos = {0};
992
+ off64_t final_offset = 0;
993
+
994
+ /* Fail if the final offset would have overflowed to match POSIX semantics. */
995
+ if (!git__is_ssizet(size) || git__add_int64_overflow(&final_offset, offset, (int64_t)size)) {
996
+ errno = EINVAL;
997
+ return -1;
998
+ }
999
+
1000
+ /*
1001
+ * Truncate large writes to the maximum allowable size: the caller
1002
+ * needs to always call this in a loop anyways.
1003
+ */
1004
+ if (size > INT32_MAX) {
1005
+ size = INT32_MAX;
1006
+ }
1007
+
1008
+ pos.QuadPart = offset;
1009
+ ov.Offset = pos.LowPart;
1010
+ ov.OffsetHigh = pos.HighPart;
1011
+ fh = (HANDLE)_get_osfhandle(fd);
1012
+
1013
+ if (ReadFile(fh, data, (DWORD)size, &rsize, &ov)) {
1014
+ return (ssize_t)rsize;
1015
+ }
1016
+
1017
+ set_errno();
1018
+ return -1;
1019
+ }
1020
+
1021
+ ssize_t p_pwrite(int fd, const void *data, size_t size, off64_t offset)
1022
+ {
1023
+ HANDLE fh;
1024
+ DWORD wsize = 0;
1025
+ OVERLAPPED ov = {0};
1026
+ LARGE_INTEGER pos = {0};
1027
+ off64_t final_offset = 0;
1028
+
1029
+ /* Fail if the final offset would have overflowed to match POSIX semantics. */
1030
+ if (!git__is_ssizet(size) || git__add_int64_overflow(&final_offset, offset, (int64_t)size)) {
1031
+ errno = EINVAL;
1032
+ return -1;
1033
+ }
1034
+
1035
+ /*
1036
+ * Truncate large writes to the maximum allowable size: the caller
1037
+ * needs to always call this in a loop anyways.
1038
+ */
1039
+ if (size > INT32_MAX) {
1040
+ size = INT32_MAX;
1041
+ }
1042
+
1043
+ pos.QuadPart = offset;
1044
+ ov.Offset = pos.LowPart;
1045
+ ov.OffsetHigh = pos.HighPart;
1046
+ fh = (HANDLE)_get_osfhandle(fd);
1047
+
1048
+ if (WriteFile(fh, data, (DWORD)size, &wsize, &ov)) {
1049
+ return (ssize_t)wsize;
1050
+ }
1051
+
1052
+ set_errno();
1053
+ return -1;
1054
+ }
@@ -259,7 +259,14 @@ int git_worktree_validate(const git_worktree *wt)
259
259
  wt->commondir_path);
260
260
  return GIT_ERROR;
261
261
  }
262
-
262
+
263
+ if (!git_path_exists(wt->worktree_path)) {
264
+ git_error_set(GIT_ERROR_WORKTREE,
265
+ "worktree directory '%s' does not exist",
266
+ wt->worktree_path);
267
+ return GIT_ERROR;
268
+ }
269
+
263
270
  return 0;
264
271
  }
265
272
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rugged
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Chacon
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-10-14 00:00:00.000000000 Z
12
+ date: 2021-07-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake-compiler