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
@@ -113,7 +113,7 @@ int git_fetch_negotiate(git_remote *remote, const git_fetch_options *opts)
113
113
  remote->need_pack = 0;
114
114
 
115
115
  if (filter_wants(remote, opts) < 0) {
116
- giterr_set(GITERR_NET, "Failed to filter the reference list for wants");
116
+ giterr_set(GITERR_NET, "failed to filter the reference list for wants");
117
117
  return -1;
118
118
  }
119
119
 
@@ -149,7 +149,7 @@ static int fetchhead_ref_parse(
149
149
 
150
150
  if (!*line) {
151
151
  giterr_set(GITERR_FETCHHEAD,
152
- "Empty line in FETCH_HEAD line %"PRIuZ, line_num);
152
+ "empty line in FETCH_HEAD line %"PRIuZ, line_num);
153
153
  return -1;
154
154
  }
155
155
 
@@ -163,13 +163,13 @@ static int fetchhead_ref_parse(
163
163
 
164
164
  if (strlen(oid_str) != GIT_OID_HEXSZ) {
165
165
  giterr_set(GITERR_FETCHHEAD,
166
- "Invalid object ID in FETCH_HEAD line %"PRIuZ, line_num);
166
+ "invalid object ID in FETCH_HEAD line %"PRIuZ, line_num);
167
167
  return -1;
168
168
  }
169
169
 
170
170
  if (git_oid_fromstr(oid, oid_str) < 0) {
171
171
  const git_error *oid_err = giterr_last();
172
- const char *err_msg = oid_err ? oid_err->message : "Invalid object ID";
172
+ const char *err_msg = oid_err ? oid_err->message : "invalid object ID";
173
173
 
174
174
  giterr_set(GITERR_FETCHHEAD, "%s in FETCH_HEAD line %"PRIuZ,
175
175
  err_msg, line_num);
@@ -180,7 +180,7 @@ static int fetchhead_ref_parse(
180
180
  if (*line) {
181
181
  if ((is_merge_str = git__strsep(&line, "\t")) == NULL) {
182
182
  giterr_set(GITERR_FETCHHEAD,
183
- "Invalid description data in FETCH_HEAD line %"PRIuZ, line_num);
183
+ "invalid description data in FETCH_HEAD line %"PRIuZ, line_num);
184
184
  return -1;
185
185
  }
186
186
 
@@ -190,13 +190,13 @@ static int fetchhead_ref_parse(
190
190
  *is_merge = 0;
191
191
  else {
192
192
  giterr_set(GITERR_FETCHHEAD,
193
- "Invalid for-merge entry in FETCH_HEAD line %"PRIuZ, line_num);
193
+ "invalid for-merge entry in FETCH_HEAD line %"PRIuZ, line_num);
194
194
  return -1;
195
195
  }
196
196
 
197
197
  if ((desc = line) == NULL) {
198
198
  giterr_set(GITERR_FETCHHEAD,
199
- "Invalid description in FETCH_HEAD line %"PRIuZ, line_num);
199
+ "invalid description in FETCH_HEAD line %"PRIuZ, line_num);
200
200
  return -1;
201
201
  }
202
202
 
@@ -213,7 +213,7 @@ static int fetchhead_ref_parse(
213
213
  if ((desc = strstr(name, "' ")) == NULL ||
214
214
  git__prefixcmp(desc, "' of ") != 0) {
215
215
  giterr_set(GITERR_FETCHHEAD,
216
- "Invalid description in FETCH_HEAD line %"PRIuZ, line_num);
216
+ "invalid description in FETCH_HEAD line %"PRIuZ, line_num);
217
217
  return -1;
218
218
  }
219
219
 
@@ -277,7 +277,7 @@ int git_repository_fetchhead_foreach(git_repository *repo,
277
277
  }
278
278
 
279
279
  if (*buffer) {
280
- giterr_set(GITERR_FETCHHEAD, "No EOL at line %"PRIuZ, line_num+1);
280
+ giterr_set(GITERR_FETCHHEAD, "no EOL at line %"PRIuZ, line_num+1);
281
281
  error = -1;
282
282
  goto done;
283
283
  }
@@ -23,7 +23,7 @@ static int verify_last_error(git_filebuf *file)
23
23
  {
24
24
  switch (file->last_error) {
25
25
  case BUFERR_WRITE:
26
- giterr_set(GITERR_OS, "Failed to write out file");
26
+ giterr_set(GITERR_OS, "failed to write out file");
27
27
  return -1;
28
28
 
29
29
  case BUFERR_MEM:
@@ -48,7 +48,7 @@ static int lock_file(git_filebuf *file, int flags, mode_t mode)
48
48
  else {
49
49
  giterr_clear(); /* actual OS error code just confuses */
50
50
  giterr_set(GITERR_OS,
51
- "Failed to lock file '%s' for writing", file->path_lock);
51
+ "failed to lock file '%s' for writing", file->path_lock);
52
52
  return GIT_ELOCKED;
53
53
  }
54
54
  }
@@ -75,7 +75,7 @@ static int lock_file(git_filebuf *file, int flags, mode_t mode)
75
75
  source = p_open(file->path_original, O_RDONLY);
76
76
  if (source < 0) {
77
77
  giterr_set(GITERR_OS,
78
- "Failed to open file '%s' for reading",
78
+ "failed to open file '%s' for reading",
79
79
  file->path_original);
80
80
  return -1;
81
81
  }
@@ -90,10 +90,10 @@ static int lock_file(git_filebuf *file, int flags, mode_t mode)
90
90
  p_close(source);
91
91
 
92
92
  if (read_bytes < 0) {
93
- giterr_set(GITERR_OS, "Failed to read file '%s'", file->path_original);
93
+ giterr_set(GITERR_OS, "failed to read file '%s'", file->path_original);
94
94
  return -1;
95
95
  } else if (error < 0) {
96
- giterr_set(GITERR_OS, "Failed to write file '%s'", file->path_lock);
96
+ giterr_set(GITERR_OS, "failed to write file '%s'", file->path_lock);
97
97
  return -1;
98
98
  }
99
99
  }
@@ -316,7 +316,7 @@ int git_filebuf_open_withsize(git_filebuf *file, const char *path, int flags, mo
316
316
  if (compression != 0) {
317
317
  /* Initialize the ZLib stream */
318
318
  if (deflateInit(&file->zs, compression) != Z_OK) {
319
- giterr_set(GITERR_ZLIB, "Failed to initialize zlib");
319
+ giterr_set(GITERR_ZLIB, "failed to initialize zlib");
320
320
  goto cleanup;
321
321
  }
322
322
 
@@ -426,14 +426,14 @@ int git_filebuf_commit(git_filebuf *file)
426
426
  file->fd_is_open = false;
427
427
 
428
428
  if (p_close(file->fd) < 0) {
429
- giterr_set(GITERR_OS, "Failed to close file at '%s'", file->path_lock);
429
+ giterr_set(GITERR_OS, "failed to close file at '%s'", file->path_lock);
430
430
  goto on_error;
431
431
  }
432
432
 
433
433
  file->fd = -1;
434
434
 
435
435
  if (p_rename(file->path_lock, file->path_original) < 0) {
436
- giterr_set(GITERR_OS, "Failed to rename lockfile to '%s'", file->path_original);
436
+ giterr_set(GITERR_OS, "failed to rename lockfile to '%s'", file->path_original);
437
437
  goto on_error;
438
438
  }
439
439
 
@@ -571,7 +571,7 @@ int git_filebuf_stats(time_t *mtime, size_t *size, git_filebuf *file)
571
571
  res = p_stat(file->path_original, &st);
572
572
 
573
573
  if (res < 0) {
574
- giterr_set(GITERR_OS, "Could not get stat info for '%s'",
574
+ giterr_set(GITERR_OS, "could not get stat info for '%s'",
575
575
  file->path_original);
576
576
  return res;
577
577
  }
@@ -37,13 +37,13 @@ int git_futils_mktmp(git_buf *path_out, const char *filename, mode_t mode)
37
37
 
38
38
  if ((fd = p_mkstemp(path_out->ptr)) < 0) {
39
39
  giterr_set(GITERR_OS,
40
- "Failed to create temporary file '%s'", path_out->ptr);
40
+ "failed to create temporary file '%s'", path_out->ptr);
41
41
  return -1;
42
42
  }
43
43
 
44
44
  if (p_chmod(path_out->ptr, (mode & ~mask))) {
45
45
  giterr_set(GITERR_OS,
46
- "Failed to set permissions on file '%s'", path_out->ptr);
46
+ "failed to set permissions on file '%s'", path_out->ptr);
47
47
  return -1;
48
48
  }
49
49
 
@@ -59,7 +59,7 @@ int git_futils_creat_withpath(const char *path, const mode_t dirmode, const mode
59
59
 
60
60
  fd = p_creat(path, mode);
61
61
  if (fd < 0) {
62
- giterr_set(GITERR_OS, "Failed to create file '%s'", path);
62
+ giterr_set(GITERR_OS, "failed to create file '%s'", path);
63
63
  return -1;
64
64
  }
65
65
 
@@ -73,7 +73,7 @@ int git_futils_creat_locked(const char *path, const mode_t mode)
73
73
 
74
74
  if (fd < 0) {
75
75
  int error = errno;
76
- giterr_set(GITERR_OS, "Failed to create locked file '%s'", path);
76
+ giterr_set(GITERR_OS, "failed to create locked file '%s'", path);
77
77
  switch (error) {
78
78
  case EEXIST:
79
79
  return GIT_ELOCKED;
@@ -108,7 +108,7 @@ git_off_t git_futils_filesize(git_file fd)
108
108
  struct stat sb;
109
109
 
110
110
  if (p_fstat(fd, &sb)) {
111
- giterr_set(GITERR_OS, "Failed to stat file descriptor");
111
+ giterr_set(GITERR_OS, "failed to stat file descriptor");
112
112
  return -1;
113
113
  }
114
114
 
@@ -137,7 +137,7 @@ int git_futils_readbuffer_fd(git_buf *buf, git_file fd, size_t len)
137
137
  git_buf_clear(buf);
138
138
 
139
139
  if (!git__is_ssizet(len)) {
140
- giterr_set(GITERR_INVALID, "Read too large.");
140
+ giterr_set(GITERR_INVALID, "read too large");
141
141
  return -1;
142
142
  }
143
143
 
@@ -149,7 +149,7 @@ int git_futils_readbuffer_fd(git_buf *buf, git_file fd, size_t len)
149
149
  read_size = p_read(fd, buf->ptr, len);
150
150
 
151
151
  if (read_size != (ssize_t)len) {
152
- giterr_set(GITERR_OS, "Failed to read descriptor");
152
+ giterr_set(GITERR_OS, "failed to read descriptor");
153
153
  git_buf_free(buf);
154
154
  return -1;
155
155
  }
@@ -184,7 +184,7 @@ int git_futils_readbuffer_updated(
184
184
  }
185
185
 
186
186
  if (!git__is_sizet(st.st_size+1)) {
187
- giterr_set(GITERR_OS, "Invalid regular file stat for '%s'", path);
187
+ giterr_set(GITERR_OS, "invalid regular file stat for '%s'", path);
188
188
  return -1;
189
189
  }
190
190
 
@@ -245,18 +245,18 @@ int git_futils_writebuffer(
245
245
  mode = GIT_FILEMODE_BLOB;
246
246
 
247
247
  if ((fd = p_open(path, flags, mode)) < 0) {
248
- giterr_set(GITERR_OS, "Could not open '%s' for writing", path);
248
+ giterr_set(GITERR_OS, "could not open '%s' for writing", path);
249
249
  return fd;
250
250
  }
251
251
 
252
252
  if ((error = p_write(fd, git_buf_cstr(buf), git_buf_len(buf))) < 0) {
253
- giterr_set(GITERR_OS, "Could not write to '%s'", path);
253
+ giterr_set(GITERR_OS, "could not write to '%s'", path);
254
254
  (void)p_close(fd);
255
255
  return error;
256
256
  }
257
257
 
258
258
  if ((error = p_close(fd)) < 0)
259
- giterr_set(GITERR_OS, "Error while closing '%s'", path);
259
+ giterr_set(GITERR_OS, "error while closing '%s'", path);
260
260
 
261
261
  return error;
262
262
  }
@@ -267,7 +267,7 @@ int git_futils_mv_withpath(const char *from, const char *to, const mode_t dirmod
267
267
  return -1;
268
268
 
269
269
  if (p_rename(from, to) < 0) {
270
- giterr_set(GITERR_OS, "Failed to rename '%s' to '%s'", from, to);
270
+ giterr_set(GITERR_OS, "failed to rename '%s' to '%s'", from, to);
271
271
  return -1;
272
272
  }
273
273
 
@@ -290,7 +290,7 @@ int git_futils_mmap_ro_file(git_map *out, const char *path)
290
290
 
291
291
  len = git_futils_filesize(fd);
292
292
  if (!git__is_sizet(len)) {
293
- giterr_set(GITERR_OS, "File `%s` too large to mmap", path);
293
+ giterr_set(GITERR_OS, "file `%s` too large to mmap", path);
294
294
  return -1;
295
295
  }
296
296
 
@@ -314,14 +314,14 @@ GIT_INLINE(int) mkdir_validate_dir(
314
314
  /* with exclusive create, existing dir is an error */
315
315
  if ((flags & GIT_MKDIR_EXCL) != 0) {
316
316
  giterr_set(GITERR_FILESYSTEM,
317
- "Failed to make directory '%s': directory exists", path);
317
+ "failed to make directory '%s': directory exists", path);
318
318
  return GIT_EEXISTS;
319
319
  }
320
320
 
321
321
  if ((S_ISREG(st->st_mode) && (flags & GIT_MKDIR_REMOVE_FILES)) ||
322
322
  (S_ISLNK(st->st_mode) && (flags & GIT_MKDIR_REMOVE_SYMLINKS))) {
323
323
  if (p_unlink(path) < 0) {
324
- giterr_set(GITERR_OS, "Failed to remove %s '%s'",
324
+ giterr_set(GITERR_OS, "failed to remove %s '%s'",
325
325
  S_ISLNK(st->st_mode) ? "symlink" : "file", path);
326
326
  return GIT_EEXISTS;
327
327
  }
@@ -329,7 +329,7 @@ GIT_INLINE(int) mkdir_validate_dir(
329
329
  opts->perfdata.mkdir_calls++;
330
330
 
331
331
  if (p_mkdir(path, mode) < 0) {
332
- giterr_set(GITERR_OS, "Failed to make directory '%s'", path);
332
+ giterr_set(GITERR_OS, "failed to make directory '%s'", path);
333
333
  return GIT_EEXISTS;
334
334
  }
335
335
  }
@@ -339,14 +339,14 @@ GIT_INLINE(int) mkdir_validate_dir(
339
339
  opts->perfdata.stat_calls++;
340
340
 
341
341
  if (p_stat(path, st) < 0) {
342
- giterr_set(GITERR_OS, "Failed to make directory '%s'", path);
342
+ giterr_set(GITERR_OS, "failed to make directory '%s'", path);
343
343
  return GIT_EEXISTS;
344
344
  }
345
345
  }
346
346
 
347
347
  else if (!S_ISDIR(st->st_mode)) {
348
348
  giterr_set(GITERR_FILESYSTEM,
349
- "Failed to make directory '%s': directory exists", path);
349
+ "failed to make directory '%s': directory exists", path);
350
350
  return GIT_EEXISTS;
351
351
  }
352
352
 
@@ -569,7 +569,7 @@ int git_futils_mkdir_relative(
569
569
  retry_lstat:
570
570
  if (p_lstat(make_path.ptr, &st) < 0) {
571
571
  if (mkdir_attempted || errno != ENOENT) {
572
- giterr_set(GITERR_OS, "Cannot access component in path '%s'", make_path.ptr);
572
+ giterr_set(GITERR_OS, "cannot access component in path '%s'", make_path.ptr);
573
573
  error = -1;
574
574
  goto done;
575
575
  }
@@ -580,7 +580,7 @@ retry_lstat:
580
580
  if (p_mkdir(make_path.ptr, mode) < 0) {
581
581
  if (errno == EEXIST)
582
582
  goto retry_lstat;
583
- giterr_set(GITERR_OS, "Failed to make directory '%s'", make_path.ptr);
583
+ giterr_set(GITERR_OS, "failed to make directory '%s'", make_path.ptr);
584
584
  error = -1;
585
585
  goto done;
586
586
  }
@@ -621,7 +621,7 @@ retry_lstat:
621
621
  opts->perfdata.stat_calls++;
622
622
 
623
623
  if (p_stat(make_path.ptr, &st) < 0 || !S_ISDIR(st.st_mode)) {
624
- giterr_set(GITERR_OS, "Path is not a directory '%s'",
624
+ giterr_set(GITERR_OS, "path is not a directory '%s'",
625
625
  make_path.ptr);
626
626
  error = GIT_ENOTFOUND;
627
627
  }
@@ -644,10 +644,10 @@ typedef struct {
644
644
  static int futils__error_cannot_rmdir(const char *path, const char *filemsg)
645
645
  {
646
646
  if (filemsg)
647
- giterr_set(GITERR_OS, "Could not remove directory. File '%s' %s",
647
+ giterr_set(GITERR_OS, "could not remove directory '%s': %s",
648
648
  path, filemsg);
649
649
  else
650
- giterr_set(GITERR_OS, "Could not remove directory '%s'", path);
650
+ giterr_set(GITERR_OS, "could not remove directory '%s'", path);
651
651
 
652
652
  return -1;
653
653
  }
@@ -815,7 +815,7 @@ static int cp_by_fd(int ifd, int ofd, bool close_fd_when_done)
815
815
  error = p_write(ofd, buffer, len);
816
816
 
817
817
  if (len < 0) {
818
- giterr_set(GITERR_OS, "Read error while copying file");
818
+ giterr_set(GITERR_OS, "read error while copying file");
819
819
  error = (int)len;
820
820
  }
821
821
 
@@ -871,14 +871,14 @@ static int cp_link(const char *from, const char *to, size_t link_size)
871
871
 
872
872
  read_len = p_readlink(from, link_data, link_size);
873
873
  if (read_len != (ssize_t)link_size) {
874
- giterr_set(GITERR_OS, "Failed to read symlink data for '%s'", from);
874
+ giterr_set(GITERR_OS, "failed to read symlink data for '%s'", from);
875
875
  error = -1;
876
876
  }
877
877
  else {
878
878
  link_data[read_len] = '\0';
879
879
 
880
880
  if (p_symlink(link_data, to) < 0) {
881
- giterr_set(GITERR_OS, "Could not symlink '%s' as '%s'",
881
+ giterr_set(GITERR_OS, "could not symlink '%s' as '%s'",
882
882
  link_data, to);
883
883
  error = -1;
884
884
  }
@@ -974,7 +974,7 @@ static int _cp_r_callback(void *ref, git_buf *from)
974
974
  return 0;
975
975
 
976
976
  if (p_unlink(info->to.ptr) < 0) {
977
- giterr_set(GITERR_OS, "Cannot overwrite existing file '%s'",
977
+ giterr_set(GITERR_OS, "cannot overwrite existing file '%s'",
978
978
  info->to.ptr);
979
979
  return GIT_EEXISTS;
980
980
  }
@@ -296,7 +296,7 @@ int git_filter_unregister(const char *name)
296
296
 
297
297
  /* cannot unregister default filters */
298
298
  if (!strcmp(GIT_FILTER_CRLF, name) || !strcmp(GIT_FILTER_IDENT, name)) {
299
- giterr_set(GITERR_FILTER, "Cannot unregister filter '%s'", name);
299
+ giterr_set(GITERR_FILTER, "cannot unregister filter '%s'", name);
300
300
  return -1;
301
301
  }
302
302
 
@@ -306,7 +306,7 @@ int git_filter_unregister(const char *name)
306
306
  }
307
307
 
308
308
  if ((fdef = filter_registry_lookup(&pos, name)) == NULL) {
309
- giterr_set(GITERR_FILTER, "Cannot find filter '%s' to unregister", name);
309
+ giterr_set(GITERR_FILTER, "cannot find filter '%s' to unregister", name);
310
310
  error = GIT_ENOTFOUND;
311
311
  goto done;
312
312
  }
@@ -645,7 +645,7 @@ int git_filter_list_push(
645
645
  git_rwlock_rdunlock(&filter_registry.lock);
646
646
 
647
647
  if (fdef == NULL) {
648
- giterr_set(GITERR_FILTER, "Cannot use an unregistered filter");
648
+ giterr_set(GITERR_FILTER, "cannot use an unregistered filter");
649
649
  return -1;
650
650
  }
651
651
 
@@ -758,7 +758,7 @@ static int buf_from_blob(git_buf *out, git_blob *blob)
758
758
  git_off_t rawsize = git_blob_rawsize(blob);
759
759
 
760
760
  if (!git__is_sizet(rawsize)) {
761
- giterr_set(GITERR_OS, "Blob is too large to filter");
761
+ giterr_set(GITERR_OS, "blob is too large to filter");
762
762
  return -1;
763
763
  }
764
764
 
@@ -214,7 +214,7 @@ static int hashsig_finalize_hashes(git_hashsig *sig)
214
214
  if (sig->mins.size < HASHSIG_HEAP_MIN_SIZE &&
215
215
  !(sig->opt & GIT_HASHSIG_ALLOW_SMALL_FILES)) {
216
216
  giterr_set(GITERR_INVALID,
217
- "File too small for similarity signature calculation");
217
+ "file too small for similarity signature calculation");
218
218
  return GIT_EBUFS;
219
219
  }
220
220
 
@@ -286,7 +286,7 @@ int git_hashsig_create_fromfile(
286
286
  if ((buflen = p_read(fd, buf, sizeof(buf))) <= 0) {
287
287
  if ((error = (int)buflen) < 0)
288
288
  giterr_set(GITERR_OS,
289
- "Read error on '%s' calculating similarity hashes", path);
289
+ "read error on '%s' calculating similarity hashes", path);
290
290
  break;
291
291
  }
292
292
 
@@ -175,7 +175,7 @@ static int parse_ignore_file(
175
175
  context = attrs->entry->path;
176
176
 
177
177
  if (git_mutex_lock(&attrs->lock) < 0) {
178
- giterr_set(GITERR_OS, "Failed to lock ignore file");
178
+ giterr_set(GITERR_OS, "failed to lock ignore file");
179
179
  return -1;
180
180
  }
181
181
 
@@ -278,7 +278,7 @@ int git_ignore__for_path(
278
278
  int error = 0;
279
279
  const char *workdir = git_repository_workdir(repo);
280
280
 
281
- assert(ignores && path);
281
+ assert(repo && ignores && path);
282
282
 
283
283
  memset(ignores, 0, sizeof(*ignores));
284
284
  ignores->repo = repo;
@@ -503,9 +503,9 @@ int git_ignore_path_is_ignored(
503
503
  unsigned int i;
504
504
  git_attr_file *file;
505
505
 
506
- assert(ignored && pathname);
506
+ assert(repo && ignored && pathname);
507
507
 
508
- workdir = repo ? git_repository_workdir(repo) : NULL;
508
+ workdir = git_repository_workdir(repo);
509
509
 
510
510
  memset(&path, 0, sizeof(path));
511
511
  memset(&ignores, 0, sizeof(ignores));