rugged 0.25.1.1 → 0.26.0b1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rugged/version.rb +1 -1
  3. data/vendor/libgit2/include/git2/common.h +10 -0
  4. data/vendor/libgit2/include/git2/merge.h +2 -1
  5. data/vendor/libgit2/include/git2/oid.h +4 -5
  6. data/vendor/libgit2/include/git2/submodule.h +2 -11
  7. data/vendor/libgit2/include/git2/sys/repository.h +29 -0
  8. data/vendor/libgit2/include/git2/tree.h +13 -0
  9. data/vendor/libgit2/src/apply.c +2 -2
  10. data/vendor/libgit2/src/attr_file.c +5 -5
  11. data/vendor/libgit2/src/attrcache.c +9 -7
  12. data/vendor/libgit2/src/blob.c +3 -3
  13. data/vendor/libgit2/src/branch.c +10 -10
  14. data/vendor/libgit2/src/buffer.c +4 -4
  15. data/vendor/libgit2/src/cache.c +1 -1
  16. data/vendor/libgit2/src/checkout.c +29 -25
  17. data/vendor/libgit2/src/cherrypick.c +2 -2
  18. data/vendor/libgit2/src/commit.c +2 -2
  19. data/vendor/libgit2/src/commit_list.c +2 -2
  20. data/vendor/libgit2/src/common.h +1 -1
  21. data/vendor/libgit2/src/config.c +12 -12
  22. data/vendor/libgit2/src/config_file.c +9 -9
  23. data/vendor/libgit2/src/crlf.c +1 -1
  24. data/vendor/libgit2/src/delta.c +4 -4
  25. data/vendor/libgit2/src/describe.c +11 -11
  26. data/vendor/libgit2/src/diff_driver.c +1 -1
  27. data/vendor/libgit2/src/diff_file.c +1 -1
  28. data/vendor/libgit2/src/diff_generate.c +2 -2
  29. data/vendor/libgit2/src/diff_print.c +5 -5
  30. data/vendor/libgit2/src/diff_tform.c +1 -1
  31. data/vendor/libgit2/src/diff_xdiff.c +2 -2
  32. data/vendor/libgit2/src/fetch.c +1 -1
  33. data/vendor/libgit2/src/fetchhead.c +8 -8
  34. data/vendor/libgit2/src/filebuf.c +9 -9
  35. data/vendor/libgit2/src/fileops.c +27 -27
  36. data/vendor/libgit2/src/filter.c +4 -4
  37. data/vendor/libgit2/src/hashsig.c +2 -2
  38. data/vendor/libgit2/src/ignore.c +4 -4
  39. data/vendor/libgit2/src/index.c +15 -15
  40. data/vendor/libgit2/src/indexer.c +39 -6
  41. data/vendor/libgit2/src/integer.h +6 -6
  42. data/vendor/libgit2/src/merge.c +12 -12
  43. data/vendor/libgit2/src/merge_file.c +1 -1
  44. data/vendor/libgit2/src/mwindow.c +1 -1
  45. data/vendor/libgit2/src/netops.c +4 -4
  46. data/vendor/libgit2/src/notes.c +3 -3
  47. data/vendor/libgit2/src/object.c +5 -5
  48. data/vendor/libgit2/src/odb.c +12 -12
  49. data/vendor/libgit2/src/odb_loose.c +6 -6
  50. data/vendor/libgit2/src/oid.c +5 -5
  51. data/vendor/libgit2/src/openssl_stream.c +3 -3
  52. data/vendor/libgit2/src/pack-objects.c +6 -6
  53. data/vendor/libgit2/src/pack.c +19 -10
  54. data/vendor/libgit2/src/pack.h +1 -0
  55. data/vendor/libgit2/src/patch_generate.c +5 -3
  56. data/vendor/libgit2/src/path.c +15 -15
  57. data/vendor/libgit2/src/pathspec.c +2 -2
  58. data/vendor/libgit2/src/posix.c +1 -1
  59. data/vendor/libgit2/src/push.c +6 -6
  60. data/vendor/libgit2/src/rebase.c +12 -12
  61. data/vendor/libgit2/src/refdb.c +1 -1
  62. data/vendor/libgit2/src/refdb_fs.c +12 -12
  63. data/vendor/libgit2/src/reflog.c +2 -2
  64. data/vendor/libgit2/src/refs.c +34 -17
  65. data/vendor/libgit2/src/refs.h +3 -0
  66. data/vendor/libgit2/src/remote.c +3 -3
  67. data/vendor/libgit2/src/repository.c +46 -13
  68. data/vendor/libgit2/src/repository.h +2 -1
  69. data/vendor/libgit2/src/reset.c +1 -1
  70. data/vendor/libgit2/src/revert.c +2 -2
  71. data/vendor/libgit2/src/revparse.c +5 -5
  72. data/vendor/libgit2/src/revwalk.c +3 -3
  73. data/vendor/libgit2/src/settings.c +6 -1
  74. data/vendor/libgit2/src/sha1_lookup.c +1 -1
  75. data/vendor/libgit2/src/signature.c +1 -1
  76. data/vendor/libgit2/src/socket_stream.c +5 -5
  77. data/vendor/libgit2/src/sortedcache.c +5 -5
  78. data/vendor/libgit2/src/stash.c +6 -6
  79. data/vendor/libgit2/src/status.c +4 -4
  80. data/vendor/libgit2/src/submodule.c +159 -110
  81. data/vendor/libgit2/src/submodule.h +3 -0
  82. data/vendor/libgit2/src/sysdir.c +2 -2
  83. data/vendor/libgit2/src/tag.c +14 -14
  84. data/vendor/libgit2/src/trace.c +1 -1
  85. data/vendor/libgit2/src/transport.c +1 -1
  86. data/vendor/libgit2/src/transports/auth_negotiate.c +4 -4
  87. data/vendor/libgit2/src/transports/cred.c +1 -1
  88. data/vendor/libgit2/src/transports/git.c +3 -3
  89. data/vendor/libgit2/src/transports/http.c +6 -6
  90. data/vendor/libgit2/src/transports/local.c +2 -2
  91. data/vendor/libgit2/src/transports/smart.c +5 -5
  92. data/vendor/libgit2/src/transports/smart_pkt.c +4 -4
  93. data/vendor/libgit2/src/transports/smart_protocol.c +1 -1
  94. data/vendor/libgit2/src/transports/ssh.c +9 -9
  95. data/vendor/libgit2/src/transports/winhttp.c +155 -118
  96. data/vendor/libgit2/src/tree-cache.c +2 -2
  97. data/vendor/libgit2/src/tree.c +35 -20
  98. data/vendor/libgit2/src/unix/map.c +1 -1
  99. data/vendor/libgit2/src/util.c +3 -3
  100. data/vendor/libgit2/src/vector.c +3 -0
  101. data/vendor/libgit2/src/win32/dir.c +3 -3
  102. data/vendor/libgit2/src/win32/findfile.c +1 -1
  103. data/vendor/libgit2/src/win32/map.c +6 -6
  104. data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.c +2 -2
  105. data/vendor/libgit2/src/win32/w32_util.c +1 -1
  106. data/vendor/libgit2/src/win32/w32_util.h +1 -1
  107. data/vendor/libgit2/src/zstream.c +1 -1
  108. metadata +4 -4
@@ -15,6 +15,8 @@
15
15
  #include "buffer.h"
16
16
  #include "oid.h"
17
17
 
18
+ extern bool git_reference__enable_symbolic_ref_target_validation;
19
+
18
20
  #define GIT_REFS_DIR "refs/"
19
21
  #define GIT_REFS_HEADS_DIR GIT_REFS_DIR "heads/"
20
22
  #define GIT_REFS_TAGS_DIR GIT_REFS_DIR "tags/"
@@ -53,6 +55,7 @@
53
55
  #define GIT_REFS_STASH_FILE GIT_REFS_DIR GIT_STASH_FILE
54
56
 
55
57
  #define GIT_REF_FORMAT__PRECOMPOSE_UNICODE (1u << 16)
58
+ #define GIT_REF_FORMAT__VALIDATION_DISABLE (1u << 15)
56
59
 
57
60
  #define GIT_REFNAME_MAX 1024
58
61
 
@@ -283,7 +283,7 @@ static int ensure_remote_doesnot_exist(git_repository *repo, const char *name)
283
283
 
284
284
  giterr_set(
285
285
  GITERR_CONFIG,
286
- "Remote '%s' already exists.", name);
286
+ "remote '%s' already exists", name);
287
287
 
288
288
  return GIT_EEXISTS;
289
289
  }
@@ -476,7 +476,7 @@ int git_remote_lookup(git_remote **out, git_repository *repo, const char *name)
476
476
 
477
477
  if (!optional_setting_found) {
478
478
  error = GIT_ENOTFOUND;
479
- giterr_set(GITERR_CONFIG, "Remote '%s' does not exist.", name);
479
+ giterr_set(GITERR_CONFIG, "remote '%s' does not exist", name);
480
480
  goto cleanup;
481
481
  }
482
482
 
@@ -1718,7 +1718,7 @@ int git_remote_set_autotag(git_repository *repo, const char *remote, git_remote_
1718
1718
  error = 0;
1719
1719
  break;
1720
1720
  default:
1721
- giterr_set(GITERR_INVALID, "Invalid value for the tagopt setting");
1721
+ giterr_set(GITERR_INVALID, "invalid value for the tagopt setting");
1722
1722
  error = -1;
1723
1723
  }
1724
1724
 
@@ -27,6 +27,10 @@
27
27
  #include "merge.h"
28
28
  #include "diff_driver.h"
29
29
  #include "annotated_commit.h"
30
+ #include "submodule.h"
31
+
32
+ GIT__USE_STRMAP
33
+ #include "strmap.h"
30
34
 
31
35
  #ifdef GIT_WIN32
32
36
  # include "win32/w32_util.h"
@@ -109,6 +113,7 @@ void git_repository__cleanup(git_repository *repo)
109
113
  {
110
114
  assert(repo);
111
115
 
116
+ git_repository_submodule_cache_clear(repo);
112
117
  git_cache_clear(&repo->objects);
113
118
  git_attr_cache_flush(repo);
114
119
 
@@ -332,7 +337,7 @@ static int read_gitfile(git_buf *path_out, const char *file_path)
332
337
  memcmp(git_buf_cstr(&file), GIT_FILE_CONTENT_PREFIX, prefix_len) != 0)
333
338
  {
334
339
  giterr_set(GITERR_REPOSITORY,
335
- "The `.git` file at '%s' is malformed", file_path);
340
+ "the `.git` file at '%s' is malformed", file_path);
336
341
  error = -1;
337
342
  }
338
343
  else if ((error = git_path_dirname_r(path_out, file_path)) >= 0) {
@@ -459,7 +464,7 @@ static int find_repo(
459
464
  * to report, report that. */
460
465
  if (!git_buf_len(repo_path) && !error) {
461
466
  giterr_set(GITERR_REPOSITORY,
462
- "Could not find repository from '%s'", start_path);
467
+ "could not find repository from '%s'", start_path);
463
468
  error = GIT_ENOTFOUND;
464
469
  }
465
470
 
@@ -481,7 +486,7 @@ int git_repository_open_bare(
481
486
 
482
487
  if (!valid_repository_path(&path)) {
483
488
  git_buf_free(&path);
484
- giterr_set(GITERR_REPOSITORY, "Path is not a repository: %s", bare_path);
489
+ giterr_set(GITERR_REPOSITORY, "path is not a repository: %s", bare_path);
485
490
  return GIT_ENOTFOUND;
486
491
  }
487
492
 
@@ -1180,7 +1185,7 @@ static int check_repositoryformatversion(git_config *config)
1180
1185
 
1181
1186
  if (GIT_REPO_VERSION < version) {
1182
1187
  giterr_set(GITERR_REPOSITORY,
1183
- "Unsupported repository version %d. Only versions up to %d are supported.",
1188
+ "unsupported repository version %d. Only versions up to %d are supported.",
1184
1189
  version, GIT_REPO_VERSION);
1185
1190
  return -1;
1186
1191
  }
@@ -1274,12 +1279,12 @@ static int create_empty_file(const char *path, mode_t mode)
1274
1279
  int fd;
1275
1280
 
1276
1281
  if ((fd = p_creat(path, mode)) < 0) {
1277
- giterr_set(GITERR_OS, "Error while creating '%s'", path);
1282
+ giterr_set(GITERR_OS, "error while creating '%s'", path);
1278
1283
  return -1;
1279
1284
  }
1280
1285
 
1281
1286
  if (p_close(fd) < 0) {
1282
- giterr_set(GITERR_OS, "Error while closing '%s'", path);
1287
+ giterr_set(GITERR_OS, "error while closing '%s'", path);
1283
1288
  return -1;
1284
1289
  }
1285
1290
 
@@ -1508,7 +1513,7 @@ static int repo_write_template(
1508
1513
 
1509
1514
  if (error)
1510
1515
  giterr_set(GITERR_OS,
1511
- "Failed to initialize repository with template '%s'", file);
1516
+ "failed to initialize repository with template '%s'", file);
1512
1517
 
1513
1518
  return error;
1514
1519
  }
@@ -1539,7 +1544,7 @@ static int repo_write_gitlink(
1539
1544
 
1540
1545
  if (!p_stat(buf.ptr, &st) && !S_ISREG(st.st_mode)) {
1541
1546
  giterr_set(GITERR_REPOSITORY,
1542
- "Cannot overwrite gitlink file into path '%s'", in_dir);
1547
+ "cannot overwrite gitlink file into path '%s'", in_dir);
1543
1548
  error = GIT_EEXISTS;
1544
1549
  goto cleanup;
1545
1550
  }
@@ -1593,7 +1598,7 @@ static int repo_init_structure(
1593
1598
  if ((opts->flags & GIT_REPOSITORY_INIT__HAS_DOTGIT) != 0) {
1594
1599
  if (git_win32__set_hidden(repo_dir, true) < 0) {
1595
1600
  giterr_set(GITERR_OS,
1596
- "Failed to mark Git repository folder as hidden");
1601
+ "failed to mark Git repository folder as hidden");
1597
1602
  return -1;
1598
1603
  }
1599
1604
  }
@@ -1747,7 +1752,7 @@ static int repo_init_directories(
1747
1752
  if (git_path_dirname_r(wd_path, repo_path->ptr) < 0)
1748
1753
  return -1;
1749
1754
  } else {
1750
- giterr_set(GITERR_REPOSITORY, "Cannot pick working directory"
1755
+ giterr_set(GITERR_REPOSITORY, "cannot pick working directory"
1751
1756
  " for non-bare repository that isn't a '.git' directory");
1752
1757
  return -1;
1753
1758
  }
@@ -1867,7 +1872,7 @@ int git_repository_init_ext(
1867
1872
 
1868
1873
  if ((opts->flags & GIT_REPOSITORY_INIT_NO_REINIT) != 0) {
1869
1874
  giterr_set(GITERR_REPOSITORY,
1870
- "Attempt to reinitialize '%s'", given_repo);
1875
+ "attempt to reinitialize '%s'", given_repo);
1871
1876
  error = GIT_EEXISTS;
1872
1877
  goto cleanup;
1873
1878
  }
@@ -2149,7 +2154,7 @@ int git_repository_message(git_buf *out, git_repository *repo)
2149
2154
  if ((error = p_stat(git_buf_cstr(&path), &st)) < 0) {
2150
2155
  if (errno == ENOENT)
2151
2156
  error = GIT_ENOTFOUND;
2152
- giterr_set(GITERR_OS, "Could not access message file");
2157
+ giterr_set(GITERR_OS, "could not access message file");
2153
2158
  } else {
2154
2159
  error = git_futils_readbuffer(out, git_buf_cstr(&path));
2155
2160
  }
@@ -2227,7 +2232,7 @@ int git_repository_hashfile(
2227
2232
  }
2228
2233
 
2229
2234
  if (!git__is_sizet(len)) {
2230
- giterr_set(GITERR_OS, "File size overflow for 32-bit systems");
2235
+ giterr_set(GITERR_OS, "file size overflow for 32-bit systems");
2231
2236
  error = -1;
2232
2237
  goto cleanup;
2233
2238
  }
@@ -2541,3 +2546,31 @@ int git_repository_set_ident(git_repository *repo, const char *name, const char
2541
2546
 
2542
2547
  return 0;
2543
2548
  }
2549
+
2550
+ int git_repository_submodule_cache_all(git_repository *repo)
2551
+ {
2552
+ int error;
2553
+
2554
+ assert(repo);
2555
+
2556
+ if ((error = git_strmap_alloc(&repo->submodule_cache)))
2557
+ return error;
2558
+
2559
+ error = git_submodule__map(repo, repo->submodule_cache);
2560
+ return error;
2561
+ }
2562
+
2563
+ int git_repository_submodule_cache_clear(git_repository *repo)
2564
+ {
2565
+ git_submodule *sm;
2566
+ assert(repo);
2567
+ if (repo->submodule_cache == NULL) {
2568
+ return 0;
2569
+ }
2570
+ git_strmap_foreach_value(repo->submodule_cache, sm, {
2571
+ git_submodule_free(sm);
2572
+ });
2573
+ git_strmap_free(repo->submodule_cache);
2574
+ repo->submodule_cache = 0;
2575
+ return 0;
2576
+ }
@@ -143,6 +143,7 @@ struct git_repository {
143
143
  git_atomic attr_session_key;
144
144
 
145
145
  git_cvar_value cvar_cache[GIT_CVAR_CACHE_MAX];
146
+ git_strmap *submodule_cache;
146
147
  };
147
148
 
148
149
  GIT_INLINE(git_attr_cache *) git_repository_attr_cache(git_repository *repo)
@@ -182,7 +183,7 @@ GIT_INLINE(int) git_repository__ensure_not_bare(
182
183
 
183
184
  giterr_set(
184
185
  GITERR_REPOSITORY,
185
- "Cannot %s. This operation is not allowed against bare repositories.",
186
+ "cannot %s. This operation is not allowed against bare repositories.",
186
187
  operation_name);
187
188
 
188
189
  return GIT_EBAREREPO;
@@ -137,7 +137,7 @@ static int reset(
137
137
  (git_repository_state(repo) == GIT_REPOSITORY_STATE_MERGE ||
138
138
  git_index_has_conflicts(index)))
139
139
  {
140
- giterr_set(GITERR_OBJECT, "%s (soft) in the middle of a merge.", ERROR_MSG);
140
+ giterr_set(GITERR_OBJECT, "%s (soft) in the middle of a merge", ERROR_MSG);
141
141
  error = GIT_EUNMERGED;
142
142
  goto cleanup;
143
143
  }
@@ -133,13 +133,13 @@ int git_revert_commit(
133
133
  if (git_commit_parentcount(revert_commit) > 1) {
134
134
  if (!mainline)
135
135
  return revert_seterr(revert_commit,
136
- "Mainline branch is not specified but %s is a merge commit");
136
+ "mainline branch is not specified but %s is a merge commit");
137
137
 
138
138
  parent = mainline;
139
139
  } else {
140
140
  if (mainline)
141
141
  return revert_seterr(revert_commit,
142
- "Mainline branch specified but %s is not a merge commit");
142
+ "mainline branch specified but %s is not a merge commit");
143
143
 
144
144
  parent = git_commit_parentcount(revert_commit);
145
145
  }
@@ -46,7 +46,7 @@ static int build_regex(regex_t *regex, const char *pattern)
46
46
  int error;
47
47
 
48
48
  if (*pattern == '\0') {
49
- giterr_set(GITERR_REGEX, "Empty pattern");
49
+ giterr_set(GITERR_REGEX, "empty pattern");
50
50
  return GIT_EINVALIDSPEC;
51
51
  }
52
52
 
@@ -118,7 +118,7 @@ static int revparse_lookup_object(
118
118
  if ((error = maybe_describe(object_out, repo, spec)) != GIT_ENOTFOUND)
119
119
  return error;
120
120
 
121
- giterr_set(GITERR_REFERENCE, "Revspec '%s' not found.", spec);
121
+ giterr_set(GITERR_REFERENCE, "revspec '%s' not found", spec);
122
122
  return GIT_ENOTFOUND;
123
123
  }
124
124
 
@@ -245,7 +245,7 @@ static int retrieve_oid_from_reflog(git_oid *oid, git_reference *ref, size_t ide
245
245
  notfound:
246
246
  giterr_set(
247
247
  GITERR_REFERENCE,
248
- "Reflog for '%s' has only %"PRIuZ" entries, asked for %"PRIuZ,
248
+ "reflog for '%s' has only %"PRIuZ" entries, asked for %"PRIuZ,
249
249
  git_reference_name(ref), numentries, identifier);
250
250
 
251
251
  git_reflog_free(reflog);
@@ -757,7 +757,7 @@ int revparse__ext(
757
757
  * TODO: support merge-stage path lookup (":2:Makefile")
758
758
  * and plain index blob lookup (:i-am/a/blob)
759
759
  */
760
- giterr_set(GITERR_INVALID, "Unimplemented");
760
+ giterr_set(GITERR_INVALID, "unimplemented");
761
761
  error = GIT_ERROR;
762
762
  goto cleanup;
763
763
  }
@@ -816,7 +816,7 @@ cleanup:
816
816
  if (error) {
817
817
  if (error == GIT_EINVALIDSPEC)
818
818
  giterr_set(GITERR_INVALID,
819
- "Failed to parse revision specifier - Invalid pattern '%s'", spec);
819
+ "failed to parse revision specifier - Invalid pattern '%s'", spec);
820
820
 
821
821
  git_object_free(base_rev);
822
822
  git_reference_free(reference);
@@ -61,7 +61,7 @@ static int push_commit(git_revwalk *walk, const git_oid *oid, int uninteresting,
61
61
  if (from_glob)
62
62
  return 0;
63
63
 
64
- giterr_set(GITERR_INVALID, "Object is not a committish");
64
+ giterr_set(GITERR_INVALID, "object is not a committish");
65
65
  return -1;
66
66
  }
67
67
  if (error < 0)
@@ -198,7 +198,7 @@ int git_revwalk_push_range(git_revwalk *walk, const char *range)
198
198
 
199
199
  if (revspec.flags & GIT_REVPARSE_MERGE_BASE) {
200
200
  /* TODO: support "<commit>...<commit>" */
201
- giterr_set(GITERR_INVALID, "Symmetric differences not implemented in revwalk");
201
+ giterr_set(GITERR_INVALID, "symmetric differences not implemented in revwalk");
202
202
  return GIT_EINVALIDSPEC;
203
203
  }
204
204
 
@@ -733,7 +733,7 @@ int git_revwalk_add_hide_cb(
733
733
 
734
734
  if (walk->hide_cb) {
735
735
  /* There is already a callback added */
736
- giterr_set(GITERR_INVALID, "There is already a callback added to hide commits in revision walker.");
736
+ giterr_set(GITERR_INVALID, "there is already a callback added to hide commits in revwalk");
737
737
  return -1;
738
738
  }
739
739
 
@@ -15,6 +15,7 @@
15
15
  #include "cache.h"
16
16
  #include "global.h"
17
17
  #include "object.h"
18
+ #include "refs.h"
18
19
 
19
20
  void git_libgit2_version(int *major, int *minor, int *rev)
20
21
  {
@@ -64,7 +65,7 @@ static int config_level_to_sysdir(int config_level)
64
65
  break;
65
66
  default:
66
67
  giterr_set(
67
- GITERR_INVALID, "Invalid config path selector %d", config_level);
68
+ GITERR_INVALID, "invalid config path selector %d", config_level);
68
69
  }
69
70
 
70
71
  return val;
@@ -193,6 +194,10 @@ int git_libgit2_opts(int key, ...)
193
194
  git_object__strict_input_validation = (va_arg(ap, int) != 0);
194
195
  break;
195
196
 
197
+ case GIT_OPT_ENABLE_STRICT_SYMBOLIC_REF_CREATION:
198
+ git_reference__enable_symbolic_ref_target_validation = (va_arg(ap, int) != 0);
199
+ break;
200
+
196
201
  case GIT_OPT_SET_SSL_CIPHERS:
197
202
  #ifdef GIT_OPENSSL
198
203
  {
@@ -206,7 +206,7 @@ int sha1_entry_pos(const void *table,
206
206
  #endif
207
207
 
208
208
  if (!(lo <= mi && mi < hi)) {
209
- giterr_set(GITERR_INVALID, "Assertion failure. Binary search invariant is false");
209
+ giterr_set(GITERR_INVALID, "assertion failure: binary search invariant is false");
210
210
  return -1;
211
211
  }
212
212
 
@@ -25,7 +25,7 @@ void git_signature_free(git_signature *sig)
25
25
 
26
26
  static int signature_error(const char *msg)
27
27
  {
28
- giterr_set(GITERR_INVALID, "Failed to parse signature - %s", msg);
28
+ giterr_set(GITERR_INVALID, "failed to parse signature - %s", msg);
29
29
  return -1;
30
30
  }
31
31
 
@@ -57,7 +57,7 @@ static int close_socket(GIT_SOCKET s)
57
57
  return -1;
58
58
 
59
59
  if (0 != WSACleanup()) {
60
- giterr_set(GITERR_OS, "Winsock cleanup failed");
60
+ giterr_set(GITERR_OS, "winsock cleanup failed");
61
61
  return -1;
62
62
  }
63
63
 
@@ -82,13 +82,13 @@ int socket_connect(git_stream *stream)
82
82
  WSADATA wsd;
83
83
 
84
84
  if (WSAStartup(MAKEWORD(2,2), &wsd) != 0) {
85
- giterr_set(GITERR_OS, "Winsock init failed");
85
+ giterr_set(GITERR_OS, "winsock init failed");
86
86
  return -1;
87
87
  }
88
88
 
89
89
  if (LOBYTE(wsd.wVersion) != 2 || HIBYTE(wsd.wVersion) != 2) {
90
90
  WSACleanup();
91
- giterr_set(GITERR_OS, "Winsock init failed");
91
+ giterr_set(GITERR_OS, "winsock init failed");
92
92
  return -1;
93
93
  }
94
94
  #endif
@@ -99,7 +99,7 @@ int socket_connect(git_stream *stream)
99
99
 
100
100
  if ((ret = p_getaddrinfo(st->host, st->port, &hints, &info)) != 0) {
101
101
  giterr_set(GITERR_NET,
102
- "Failed to resolve address for %s: %s", st->host, p_gai_strerror(ret));
102
+ "failed to resolve address for %s: %s", st->host, p_gai_strerror(ret));
103
103
  return -1;
104
104
  }
105
105
 
@@ -121,7 +121,7 @@ int socket_connect(git_stream *stream)
121
121
 
122
122
  /* Oops, we couldn't connect to any address */
123
123
  if (s == INVALID_SOCKET && p == NULL) {
124
- giterr_set(GITERR_OS, "Failed to connect to %s", st->host);
124
+ giterr_set(GITERR_OS, "failed to connect to %s", st->host);
125
125
  p_freeaddrinfo(info);
126
126
  return -1;
127
127
  }
@@ -27,7 +27,7 @@ int git_sortedcache_new(
27
27
  goto fail;
28
28
 
29
29
  if (git_rwlock_init(&sc->lock)) {
30
- giterr_set(GITERR_OS, "Failed to initialize lock");
30
+ giterr_set(GITERR_OS, "failed to initialize lock");
31
31
  goto fail;
32
32
  }
33
33
 
@@ -162,7 +162,7 @@ int git_sortedcache_wlock(git_sortedcache *sc)
162
162
  GIT_UNUSED(sc); /* prevent warning when compiled w/o threads */
163
163
 
164
164
  if (git_rwlock_wrlock(&sc->lock) < 0) {
165
- giterr_set(GITERR_OS, "Unable to acquire write lock on cache");
165
+ giterr_set(GITERR_OS, "unable to acquire write lock on cache");
166
166
  return -1;
167
167
  }
168
168
  return 0;
@@ -181,7 +181,7 @@ int git_sortedcache_rlock(git_sortedcache *sc)
181
181
  GIT_UNUSED(sc); /* prevent warning when compiled w/o threads */
182
182
 
183
183
  if (git_rwlock_rdlock(&sc->lock) < 0) {
184
- giterr_set(GITERR_OS, "Unable to acquire read lock on cache");
184
+ giterr_set(GITERR_OS, "unable to acquire read lock on cache");
185
185
  return -1;
186
186
  }
187
187
  return 0;
@@ -221,7 +221,7 @@ int git_sortedcache_lockandload(git_sortedcache *sc, git_buf *buf)
221
221
  }
222
222
 
223
223
  if (!git__is_sizet(st.st_size)) {
224
- giterr_set(GITERR_INVALID, "Unable to load file larger than size_t");
224
+ giterr_set(GITERR_INVALID, "unable to load file larger than size_t");
225
225
  error = -1;
226
226
  (void)p_close(fd);
227
227
  goto unlock;
@@ -373,7 +373,7 @@ int git_sortedcache_remove(git_sortedcache *sc, size_t pos)
373
373
  */
374
374
 
375
375
  if ((item = git_vector_get(&sc->items, pos)) == NULL) {
376
- giterr_set(GITERR_INVALID, "Removing item out of range");
376
+ giterr_set(GITERR_INVALID, "removing item out of range");
377
377
  return GIT_ENOTFOUND;
378
378
  }
379
379