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
@@ -570,7 +570,7 @@ int git_index_set_caps(git_index *index, int caps)
570
570
 
571
571
  if (!repo)
572
572
  return create_index_error(
573
- -1, "Cannot access repository to set index caps");
573
+ -1, "cannot access repository to set index caps");
574
574
 
575
575
  if (!git_repository__cvar(&val, repo, GIT_CVAR_IGNORECASE))
576
576
  index->ignore_case = (val != 0);
@@ -639,7 +639,7 @@ int git_index_read(git_index *index, int force)
639
639
 
640
640
  if (!index->index_file_path)
641
641
  return create_index_error(-1,
642
- "Failed to read index: The index is in-memory only");
642
+ "failed to read index: The index is in-memory only");
643
643
 
644
644
  index->on_disk = git_path_exists(index->index_file_path);
645
645
 
@@ -653,7 +653,7 @@ int git_index_read(git_index *index, int force)
653
653
  ((updated = compare_checksum(index)) < 0)) {
654
654
  giterr_set(
655
655
  GITERR_INDEX,
656
- "Failed to read index: '%s' no longer exists",
656
+ "failed to read index: '%s' no longer exists",
657
657
  index->index_file_path);
658
658
  return updated;
659
659
  }
@@ -765,7 +765,7 @@ int git_index_set_version(git_index *index, unsigned int version)
765
765
 
766
766
  if (version < INDEX_VERSION_NUMBER_LB ||
767
767
  version > INDEX_VERSION_NUMBER_UB) {
768
- giterr_set(GITERR_INDEX, "Invalid version number");
768
+ giterr_set(GITERR_INDEX, "invalid version number");
769
769
  return -1;
770
770
  }
771
771
 
@@ -805,7 +805,7 @@ int git_index_write_tree(git_oid *oid, git_index *index)
805
805
 
806
806
  if (repo == NULL)
807
807
  return create_index_error(-1, "Failed to write tree. "
808
- "The index file is not backed up by an existing repository");
808
+ "the index file is not backed up by an existing repository");
809
809
 
810
810
  return git_tree__write_index(oid, index, repo);
811
811
  }
@@ -847,7 +847,7 @@ const git_index_entry *git_index_get_bypath(
847
847
  if (git_idxmap_valid_index(index->entries_map, pos))
848
848
  return git_idxmap_value_at(index->entries_map, pos);
849
849
 
850
- giterr_set(GITERR_INDEX, "Index does not contain %s", path);
850
+ giterr_set(GITERR_INDEX, "index does not contain '%s'", path);
851
851
  return NULL;
852
852
  }
853
853
 
@@ -934,7 +934,7 @@ static int index_entry_init(
934
934
 
935
935
  if (INDEX_OWNER(index) == NULL)
936
936
  return create_index_error(-1,
937
- "Could not initialize index entry. "
937
+ "could not initialize index entry. "
938
938
  "Index is not backed up by an existing repository.");
939
939
 
940
940
  if (index_entry_create(&entry, INDEX_OWNER(index), rel_path, true) < 0)
@@ -1423,7 +1423,7 @@ int git_index_add_frombuffer(
1423
1423
 
1424
1424
  if (INDEX_OWNER(index) == NULL)
1425
1425
  return create_index_error(-1,
1426
- "Could not initialize index entry. "
1426
+ "could not initialize index entry. "
1427
1427
  "Index is not backed up by an existing repository.");
1428
1428
 
1429
1429
  if (!valid_filemode(source_entry->mode)) {
@@ -1637,7 +1637,7 @@ int git_index_remove(git_index *index, const char *path, int stage)
1637
1637
 
1638
1638
  if (index_find(&position, index, path, 0, stage) < 0) {
1639
1639
  giterr_set(
1640
- GITERR_INDEX, "Index does not contain %s at stage %d", path, stage);
1640
+ GITERR_INDEX, "index does not contain %s at stage %d", path, stage);
1641
1641
  error = GIT_ENOTFOUND;
1642
1642
  } else {
1643
1643
  error = index_remove_entry(index, position);
@@ -1709,7 +1709,7 @@ int git_index_find(size_t *at_pos, git_index *index, const char *path)
1709
1709
 
1710
1710
  if (git_vector_bsearch2(
1711
1711
  &pos, &index->entries, index->entries_search_path, path) < 0) {
1712
- giterr_set(GITERR_INDEX, "Index does not contain %s", path);
1712
+ giterr_set(GITERR_INDEX, "index does not contain %s", path);
1713
1713
  return GIT_ENOTFOUND;
1714
1714
  }
1715
1715
 
@@ -2153,7 +2153,7 @@ void git_index_reuc_clear(git_index *index)
2153
2153
 
2154
2154
  static int index_error_invalid(const char *message)
2155
2155
  {
2156
- giterr_set(GITERR_INDEX, "Invalid data in index - %s", message);
2156
+ giterr_set(GITERR_INDEX, "invalid data in index - %s", message);
2157
2157
  return -1;
2158
2158
  }
2159
2159
 
@@ -3390,7 +3390,7 @@ static int index_apply_to_all(
3390
3390
  i--; /* back up foreach if we removed this */
3391
3391
  break;
3392
3392
  default:
3393
- giterr_set(GITERR_INVALID, "Unknown index action %d", action);
3393
+ giterr_set(GITERR_INVALID, "unknown index action %d", action);
3394
3394
  error = -1;
3395
3395
  break;
3396
3396
  }
@@ -3475,13 +3475,13 @@ int git_indexwriter_init(
3475
3475
 
3476
3476
  if (!index->index_file_path)
3477
3477
  return create_index_error(-1,
3478
- "Failed to write index: The index is in-memory only");
3478
+ "failed to write index: The index is in-memory only");
3479
3479
 
3480
3480
  if ((error = git_filebuf_open(
3481
3481
  &writer->file, index->index_file_path, GIT_FILEBUF_HASH_CONTENTS, GIT_INDEX_FILE_MODE)) < 0) {
3482
3482
 
3483
3483
  if (error == GIT_ELOCKED)
3484
- giterr_set(GITERR_INDEX, "The index is locked. This might be due to a concurrent or crashed process");
3484
+ giterr_set(GITERR_INDEX, "the index is locked; this might be due to a concurrent or crashed process");
3485
3485
 
3486
3486
  return error;
3487
3487
  }
@@ -3530,7 +3530,7 @@ int git_indexwriter_commit(git_indexwriter *writer)
3530
3530
 
3531
3531
  if ((error = git_futils_filestamp_check(
3532
3532
  &writer->index->stamp, writer->index->index_file_path)) < 0) {
3533
- giterr_set(GITERR_OS, "Could not read index timestamp");
3533
+ giterr_set(GITERR_OS, "could not read index timestamp");
3534
3534
  return -1;
3535
3535
  }
3536
3536
 
@@ -33,7 +33,7 @@ struct entry {
33
33
 
34
34
  struct git_indexer {
35
35
  unsigned int parsed_header :1,
36
- opened_pack :1,
36
+ pack_committed :1,
37
37
  have_stream :1,
38
38
  have_delta :1;
39
39
  struct git_pack_header hdr;
@@ -83,12 +83,12 @@ static int parse_header(struct git_pack_header *hdr, struct git_pack_file *pack)
83
83
 
84
84
  /* Verify we recognize this pack file format. */
85
85
  if (hdr->hdr_signature != ntohl(PACK_SIGNATURE)) {
86
- giterr_set(GITERR_INDEXER, "Wrong pack signature");
86
+ giterr_set(GITERR_INDEXER, "wrong pack signature");
87
87
  return -1;
88
88
  }
89
89
 
90
90
  if (!pack_version_ok(hdr->hdr_version)) {
91
- giterr_set(GITERR_INDEXER, "Wrong pack version");
91
+ giterr_set(GITERR_INDEXER, "wrong pack version");
92
92
  return -1;
93
93
  }
94
94
 
@@ -151,6 +151,12 @@ cleanup:
151
151
  if (fd != -1)
152
152
  p_close(fd);
153
153
 
154
+ if (git_buf_len(&tmp_path) > 0)
155
+ p_unlink(git_buf_cstr(&tmp_path));
156
+
157
+ if (idx->pack != NULL)
158
+ p_unlink(idx->pack->pack_name);
159
+
154
160
  git_buf_free(&path);
155
161
  git_buf_free(&tmp_path);
156
162
  git__free(idx);
@@ -376,7 +382,7 @@ static int hash_and_save(git_indexer *idx, git_rawobj *obj, git_off_t entry_star
376
382
  GITERR_CHECK_ALLOC(entry);
377
383
 
378
384
  if (git_odb__hashobj(&oid, obj) < 0) {
379
- giterr_set(GITERR_INDEXER, "Failed to hash object");
385
+ giterr_set(GITERR_INDEXER, "failed to hash object");
380
386
  goto on_error;
381
387
  }
382
388
 
@@ -477,13 +483,29 @@ static int write_at(git_indexer *idx, const void *data, git_off_t offset, size_t
477
483
 
478
484
  static int append_to_pack(git_indexer *idx, const void *data, size_t size)
479
485
  {
486
+ git_off_t new_size;
487
+ size_t mmap_alignment;
488
+ size_t page_offset;
489
+ git_off_t page_start;
480
490
  git_off_t current_size = idx->pack->mwf.size;
481
491
  int fd = idx->pack->mwf.fd;
492
+ int error;
482
493
 
483
494
  if (!size)
484
495
  return 0;
485
496
 
486
- if (p_lseek(fd, current_size + size - 1, SEEK_SET) < 0 ||
497
+ if ((error = git__mmap_alignment(&mmap_alignment)) < 0)
498
+ return error;
499
+
500
+ /* Write a single byte to force the file system to allocate space now or
501
+ * report an error, since we can't report errors when writing using mmap.
502
+ * Round the size up to the nearest page so that we only need to perform file
503
+ * I/O when we add a page, instead of whenever we write even a single byte. */
504
+ new_size = current_size + size;
505
+ page_offset = new_size % mmap_alignment;
506
+ page_start = new_size - page_offset;
507
+
508
+ if (p_lseek(fd, page_start + mmap_alignment - 1, SEEK_SET) < 0 ||
487
509
  p_write(idx->pack->mwf.fd, data, 1) < 0) {
488
510
  giterr_set(GITERR_OS, "cannot extend packfile '%s'", idx->pack->pack_name);
489
511
  return -1;
@@ -1041,6 +1063,13 @@ int git_indexer_commit(git_indexer *idx, git_transfer_progress *stats)
1041
1063
  goto on_error;
1042
1064
 
1043
1065
  git_mwindow_free_all(&idx->pack->mwf);
1066
+
1067
+ /* Truncate file to undo rounding up to next page_size in append_to_pack */
1068
+ if (p_ftruncate(idx->pack->mwf.fd, idx->pack->mwf.size) < 0) {
1069
+ giterr_set(GITERR_OS, "failed to truncate pack file '%s'", idx->pack->pack_name);
1070
+ return -1;
1071
+ }
1072
+
1044
1073
  /* We need to close the descriptor here so Windows doesn't choke on commit_at */
1045
1074
  if (p_close(idx->pack->mwf.fd) < 0) {
1046
1075
  giterr_set(GITERR_OS, "failed to close packfile");
@@ -1054,6 +1083,7 @@ int git_indexer_commit(git_indexer *idx, git_transfer_progress *stats)
1054
1083
 
1055
1084
  /* And don't forget to rename the packfile to its new place. */
1056
1085
  p_rename(idx->pack->pack_name, git_buf_cstr(&filename));
1086
+ idx->pack_committed = 1;
1057
1087
 
1058
1088
  git_buf_free(&filename);
1059
1089
  git_hash_ctx_cleanup(&ctx);
@@ -1074,7 +1104,7 @@ void git_indexer_free(git_indexer *idx)
1074
1104
 
1075
1105
  git_vector_free_deep(&idx->objects);
1076
1106
 
1077
- if (idx->pack && idx->pack->idx_cache) {
1107
+ if (idx->pack->idx_cache) {
1078
1108
  struct git_pack_entry *pentry;
1079
1109
  kh_foreach_value(
1080
1110
  idx->pack->idx_cache, pentry, { git__free(pentry); });
@@ -1085,6 +1115,9 @@ void git_indexer_free(git_indexer *idx)
1085
1115
  git_vector_free_deep(&idx->deltas);
1086
1116
 
1087
1117
  if (!git_mutex_lock(&git__mwindow_mutex)) {
1118
+ if (!idx->pack_committed)
1119
+ git_packfile_close(idx->pack, true);
1120
+
1088
1121
  git_packfile_free(idx->pack);
1089
1122
  git_mutex_unlock(&git__mwindow_mutex);
1090
1123
  }
@@ -55,16 +55,16 @@ GIT_INLINE(bool) git__add_uint64_overflow(uint64_t *out, uint64_t one, uint64_t
55
55
  }
56
56
 
57
57
  /* Use clang/gcc compiler intrinsics whenever possible */
58
- #if (SIZE_MAX == UINT_MAX) && __has_builtin(__builtin_uadd_overflow)
59
- # define git__add_sizet_overflow(out, one, two) \
60
- __builtin_uadd_overflow(one, two, out)
61
- # define git__multiply_sizet_overflow(out, one, two) \
62
- __builtin_umul_overflow(one, two, out)
63
- #elif (SIZE_MAX == ULONG_MAX) && __has_builtin(__builtin_uaddl_overflow)
58
+ #if (SIZE_MAX == ULONG_MAX) && __has_builtin(__builtin_uaddl_overflow)
64
59
  # define git__add_sizet_overflow(out, one, two) \
65
60
  __builtin_uaddl_overflow(one, two, out)
66
61
  # define git__multiply_sizet_overflow(out, one, two) \
67
62
  __builtin_umull_overflow(one, two, out)
63
+ #elif (SIZE_MAX == UINT_MAX) && __has_builtin(__builtin_uadd_overflow)
64
+ # define git__add_sizet_overflow(out, one, two) \
65
+ __builtin_uadd_overflow(one, two, out)
66
+ # define git__multiply_sizet_overflow(out, one, two) \
67
+ __builtin_umul_overflow(one, two, out)
68
68
  #else
69
69
 
70
70
  /**
@@ -78,7 +78,7 @@ int merge_bases_many(git_commit_list **out, git_revwalk **walk_out, git_reposito
78
78
  unsigned int i;
79
79
 
80
80
  if (length < 2) {
81
- giterr_set(GITERR_INVALID, "At least two commits are required to find an ancestor. Provided 'length' was %" PRIuZ ".", length);
81
+ giterr_set(GITERR_INVALID, "at least two commits are required to find an ancestor");
82
82
  return -1;
83
83
  }
84
84
 
@@ -104,7 +104,7 @@ int merge_bases_many(git_commit_list **out, git_revwalk **walk_out, git_reposito
104
104
  goto on_error;
105
105
 
106
106
  if (!result) {
107
- giterr_set(GITERR_MERGE, "No merge base found");
107
+ giterr_set(GITERR_MERGE, "no merge base found");
108
108
  error = GIT_ENOTFOUND;
109
109
  goto on_error;
110
110
  }
@@ -184,7 +184,7 @@ int git_merge_base_octopus(git_oid *out, git_repository *repo, size_t length, co
184
184
  assert(out && repo && input_array);
185
185
 
186
186
  if (length < 2) {
187
- giterr_set(GITERR_INVALID, "At least two commits are required to find an ancestor. Provided 'length' was %" PRIuZ ".", length);
187
+ giterr_set(GITERR_INVALID, "at least two commits are required to find an ancestor");
188
188
  return -1;
189
189
  }
190
190
 
@@ -230,7 +230,7 @@ static int merge_bases(git_commit_list **out, git_revwalk **walk_out, git_reposi
230
230
 
231
231
  if (!result) {
232
232
  git_revwalk_free(walk);
233
- giterr_set(GITERR_MERGE, "No merge base found");
233
+ giterr_set(GITERR_MERGE, "no merge base found");
234
234
  return GIT_ENOTFOUND;
235
235
  }
236
236
 
@@ -574,7 +574,7 @@ int git_repository_mergehead_foreach(
574
574
 
575
575
  while ((line = git__strsep(&buffer, "\n")) != NULL) {
576
576
  if (strlen(line) != GIT_OID_HEXSZ) {
577
- giterr_set(GITERR_INVALID, "Unable to parse OID - invalid length");
577
+ giterr_set(GITERR_INVALID, "unable to parse OID - invalid length");
578
578
  error = -1;
579
579
  goto cleanup;
580
580
  }
@@ -591,7 +591,7 @@ int git_repository_mergehead_foreach(
591
591
  }
592
592
 
593
593
  if (*buffer) {
594
- giterr_set(GITERR_MERGE, "No EOL at line %"PRIuZ, line_num);
594
+ giterr_set(GITERR_MERGE, "no EOL at line %"PRIuZ, line_num);
595
595
  error = -1;
596
596
  goto cleanup;
597
597
  }
@@ -1713,15 +1713,15 @@ static int merge_normalize_opts(
1713
1713
  if ((error = git_repository_config__weakptr(&cfg, repo)) < 0)
1714
1714
  return error;
1715
1715
 
1716
- if (given != NULL)
1716
+ if (given != NULL) {
1717
1717
  memcpy(opts, given, sizeof(git_merge_options));
1718
- else {
1718
+ } else {
1719
1719
  git_merge_options init = GIT_MERGE_OPTIONS_INIT;
1720
1720
  memcpy(opts, &init, sizeof(init));
1721
+ }
1721
1722
 
1722
- opts->flags = GIT_MERGE_FIND_RENAMES;
1723
+ if ((opts->flags & GIT_MERGE_FIND_RENAMES) && !opts->rename_threshold)
1723
1724
  opts->rename_threshold = GIT_MERGE_DEFAULT_RENAME_THRESHOLD;
1724
- }
1725
1725
 
1726
1726
  if (given && given->default_driver) {
1727
1727
  opts->default_driver = git__strdup(given->default_driver);
@@ -3043,7 +3043,7 @@ int git_merge_analysis(
3043
3043
  assert(analysis_out && preference_out && repo && their_heads);
3044
3044
 
3045
3045
  if (their_heads_len != 1) {
3046
- giterr_set(GITERR_MERGE, "Can only merge a single branch");
3046
+ giterr_set(GITERR_MERGE, "can only merge a single branch");
3047
3047
  error = -1;
3048
3048
  goto done;
3049
3049
  }
@@ -3099,7 +3099,7 @@ int git_merge(
3099
3099
  assert(repo && their_heads);
3100
3100
 
3101
3101
  if (their_heads_len != 1) {
3102
- giterr_set(GITERR_MERGE, "Can only merge a single branch");
3102
+ giterr_set(GITERR_MERGE, "can only merge a single branch");
3103
3103
  return -1;
3104
3104
  }
3105
3105
 
@@ -127,7 +127,7 @@ static int merge_file__xdiff(
127
127
 
128
128
  if ((xdl_result = xdl_merge(&ancestor_mmfile, &our_mmfile,
129
129
  &their_mmfile, &xmparam, &mmbuffer)) < 0) {
130
- giterr_set(GITERR_MERGE, "Failed to merge files.");
130
+ giterr_set(GITERR_MERGE, "failed to merge files");
131
131
  error = -1;
132
132
  goto done;
133
133
  }
@@ -231,7 +231,7 @@ static int git_mwindow_close_lru(git_mwindow_file *mwf)
231
231
  }
232
232
 
233
233
  if (!lru_w) {
234
- giterr_set(GITERR_OS, "Failed to close memory window. Couldn't find LRU");
234
+ giterr_set(GITERR_OS, "failed to close memory window; couldn't find LRU");
235
235
  return -1;
236
236
  }
237
237
 
@@ -144,7 +144,7 @@ int gitno_connection_data_from_url(
144
144
  default_port = "80";
145
145
 
146
146
  if (data->use_ssl) {
147
- giterr_set(GITERR_NET, "Redirect from HTTPS to HTTP is not allowed");
147
+ giterr_set(GITERR_NET, "redirect from HTTPS to HTTP is not allowed");
148
148
  goto cleanup;
149
149
  }
150
150
  } else if (!git__prefixcmp(url, prefix_https)) {
@@ -155,7 +155,7 @@ int gitno_connection_data_from_url(
155
155
  default_port = data->use_ssl ? "443" : "80";
156
156
 
157
157
  if (!default_port) {
158
- giterr_set(GITERR_NET, "Unrecognized URL prefix");
158
+ giterr_set(GITERR_NET, "unrecognized URL prefix");
159
159
  goto cleanup;
160
160
  }
161
161
 
@@ -187,7 +187,7 @@ int gitno_connection_data_from_url(
187
187
 
188
188
  /* Check for errors in the resulting data */
189
189
  if (original_host && url[0] != '/' && strcmp(original_host, data->host)) {
190
- giterr_set(GITERR_NET, "Cross host redirect not allowed");
190
+ giterr_set(GITERR_NET, "cross host redirect not allowed");
191
191
  error = -1;
192
192
  }
193
193
  }
@@ -237,7 +237,7 @@ int gitno_extract_url_parts(
237
237
  const char *_host, *_port, *_path, *_userinfo;
238
238
 
239
239
  if (http_parser_parse_url(url, strlen(url), false, &u)) {
240
- giterr_set(GITERR_NET, "Malformed URL '%s'", url);
240
+ giterr_set(GITERR_NET, "malformed URL '%s'", url);
241
241
  return GIT_EINVALIDSPEC;
242
242
  }
243
243
 
@@ -15,7 +15,7 @@
15
15
 
16
16
  static int note_error_notfound(void)
17
17
  {
18
- giterr_set(GITERR_INVALID, "Note could not be found");
18
+ giterr_set(GITERR_INVALID, "note could not be found");
19
19
  return GIT_ENOTFOUND;
20
20
  }
21
21
 
@@ -226,7 +226,7 @@ static int remove_note_in_tree_enotfound_cb(
226
226
  GIT_UNUSED(note_oid);
227
227
  GIT_UNUSED(fanout);
228
228
 
229
- giterr_set(GITERR_REPOSITORY, "Object '%s' has no note", annotated_object_sha);
229
+ giterr_set(GITERR_REPOSITORY, "object '%s' has no note", annotated_object_sha);
230
230
  return current_error;
231
231
  }
232
232
 
@@ -244,7 +244,7 @@ static int insert_note_in_tree_eexists_cb(git_tree **out,
244
244
  GIT_UNUSED(note_oid);
245
245
  GIT_UNUSED(fanout);
246
246
 
247
- giterr_set(GITERR_REPOSITORY, "Note for '%s' exists already", annotated_object_sha);
247
+ giterr_set(GITERR_REPOSITORY, "note for '%s' exists already", annotated_object_sha);
248
248
  return current_error;
249
249
  }
250
250
 
@@ -66,12 +66,12 @@ int git_object__from_odb_object(
66
66
  /* Validate type match */
67
67
  if (type != GIT_OBJ_ANY && type != odb_obj->cached.type) {
68
68
  giterr_set(GITERR_INVALID,
69
- "The requested type does not match the type in the ODB");
69
+ "the requested type does not match the type in the ODB");
70
70
  return GIT_ENOTFOUND;
71
71
  }
72
72
 
73
73
  if ((object_size = git_object__size(odb_obj->cached.type)) == 0) {
74
- giterr_set(GITERR_INVALID, "The requested type is invalid");
74
+ giterr_set(GITERR_INVALID, "the requested type is invalid");
75
75
  return GIT_ENOTFOUND;
76
76
  }
77
77
 
@@ -122,7 +122,7 @@ int git_object_lookup_prefix(
122
122
  assert(repo && object_out && id);
123
123
 
124
124
  if (len < GIT_OID_MINPREFIXLEN) {
125
- giterr_set(GITERR_OBJECT, "Ambiguous lookup - OID prefix is too short");
125
+ giterr_set(GITERR_OBJECT, "ambiguous lookup - OID prefix is too short");
126
126
  return GIT_EAMBIGUOUS;
127
127
  }
128
128
 
@@ -147,7 +147,7 @@ int git_object_lookup_prefix(
147
147
  if (type != GIT_OBJ_ANY && type != object->cached.type) {
148
148
  git_object_free(object);
149
149
  giterr_set(GITERR_INVALID,
150
- "The requested type does not match the type in ODB");
150
+ "the requested type does not match the type in ODB");
151
151
  return GIT_ENOTFOUND;
152
152
  }
153
153
 
@@ -292,7 +292,7 @@ static int peel_error(int error, const git_oid *oid, git_otype type)
292
292
  git_oid_fmt(hex_oid, oid);
293
293
  hex_oid[GIT_OID_HEXSZ] = '\0';
294
294
 
295
- giterr_set(GITERR_OBJECT, "The git_object of id '%s' can not be "
295
+ giterr_set(GITERR_OBJECT, "the git_object of id '%s' can not be "
296
296
  "successfully peeled into a %s (git_otype=%i).", hex_oid, type_name, type);
297
297
 
298
298
  return error;