rugged 0.24.6.1 → 0.25.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (213) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/ext/rugged/extconf.rb +9 -2
  4. data/ext/rugged/rugged.c +85 -21
  5. data/ext/rugged/rugged.h +7 -21
  6. data/ext/rugged/rugged_backend.c +3 -20
  7. data/ext/rugged/rugged_blame.c +7 -24
  8. data/ext/rugged/rugged_blob.c +136 -59
  9. data/ext/rugged/rugged_branch.c +3 -20
  10. data/ext/rugged/rugged_branch_collection.c +3 -20
  11. data/ext/rugged/rugged_commit.c +251 -101
  12. data/ext/rugged/rugged_config.c +3 -20
  13. data/ext/rugged/rugged_cred.c +3 -20
  14. data/ext/rugged/rugged_diff.c +3 -20
  15. data/ext/rugged/rugged_diff_delta.c +3 -20
  16. data/ext/rugged/rugged_diff_hunk.c +3 -20
  17. data/ext/rugged/rugged_diff_line.c +3 -20
  18. data/ext/rugged/rugged_index.c +46 -229
  19. data/ext/rugged/rugged_note.c +3 -20
  20. data/ext/rugged/rugged_object.c +3 -20
  21. data/ext/rugged/rugged_patch.c +192 -34
  22. data/ext/rugged/rugged_rebase.c +90 -48
  23. data/ext/rugged/rugged_reference.c +4 -21
  24. data/ext/rugged/rugged_reference_collection.c +3 -20
  25. data/ext/rugged/rugged_remote.c +70 -42
  26. data/ext/rugged/rugged_remote_collection.c +3 -20
  27. data/ext/rugged/rugged_repo.c +50 -59
  28. data/ext/rugged/rugged_revwalk.c +4 -21
  29. data/ext/rugged/rugged_settings.c +3 -20
  30. data/ext/rugged/rugged_signature.c +3 -20
  31. data/ext/rugged/rugged_submodule.c +4 -21
  32. data/ext/rugged/rugged_submodule_collection.c +3 -20
  33. data/ext/rugged/rugged_tag.c +3 -20
  34. data/ext/rugged/rugged_tag_collection.c +3 -20
  35. data/ext/rugged/rugged_tree.c +189 -184
  36. data/lib/rugged/attributes.rb +5 -0
  37. data/lib/rugged/blob.rb +5 -0
  38. data/lib/rugged/branch.rb +6 -1
  39. data/lib/rugged/commit.rb +5 -0
  40. data/lib/rugged/console.rb +5 -0
  41. data/lib/rugged/credentials.rb +5 -0
  42. data/lib/rugged/diff/delta.rb +5 -0
  43. data/lib/rugged/diff/hunk.rb +5 -0
  44. data/lib/rugged/diff/line.rb +5 -0
  45. data/lib/rugged/diff.rb +5 -0
  46. data/lib/rugged/index.rb +120 -0
  47. data/lib/rugged/object.rb +5 -0
  48. data/lib/rugged/patch.rb +5 -0
  49. data/lib/rugged/reference.rb +5 -0
  50. data/lib/rugged/remote.rb +5 -0
  51. data/lib/rugged/repository.rb +9 -4
  52. data/lib/rugged/submodule_collection.rb +5 -0
  53. data/lib/rugged/tag.rb +5 -0
  54. data/lib/rugged/tree.rb +156 -1
  55. data/lib/rugged/version.rb +6 -1
  56. data/lib/rugged/walker.rb +5 -0
  57. data/lib/rugged.rb +5 -0
  58. data/vendor/libgit2/CMakeLists.txt +12 -2
  59. data/vendor/libgit2/include/git2/blob.h +39 -28
  60. data/vendor/libgit2/include/git2/commit.h +76 -0
  61. data/vendor/libgit2/include/git2/common.h +21 -1
  62. data/vendor/libgit2/include/git2/describe.h +5 -2
  63. data/vendor/libgit2/include/git2/diff.h +62 -7
  64. data/vendor/libgit2/include/git2/errors.h +2 -1
  65. data/vendor/libgit2/include/git2/index.h +25 -0
  66. data/vendor/libgit2/include/git2/merge.h +10 -1
  67. data/vendor/libgit2/include/git2/odb.h +47 -1
  68. data/vendor/libgit2/include/git2/pack.h +4 -4
  69. data/vendor/libgit2/include/git2/patch.h +1 -1
  70. data/vendor/libgit2/include/git2/proxy.h +92 -0
  71. data/vendor/libgit2/include/git2/refs.h +11 -0
  72. data/vendor/libgit2/include/git2/remote.h +21 -8
  73. data/vendor/libgit2/include/git2/repository.h +20 -1
  74. data/vendor/libgit2/include/git2/revwalk.h +4 -6
  75. data/vendor/libgit2/include/git2/signature.h +13 -0
  76. data/vendor/libgit2/include/git2/submodule.h +11 -3
  77. data/vendor/libgit2/include/git2/sys/merge.h +177 -0
  78. data/vendor/libgit2/include/git2/sys/odb_backend.h +11 -0
  79. data/vendor/libgit2/include/git2/sys/remote.h +16 -0
  80. data/vendor/libgit2/include/git2/sys/stream.h +2 -1
  81. data/vendor/libgit2/include/git2/sys/time.h +31 -0
  82. data/vendor/libgit2/include/git2/sys/transport.h +3 -1
  83. data/vendor/libgit2/include/git2/tag.h +9 -0
  84. data/vendor/libgit2/include/git2/transaction.h +9 -0
  85. data/vendor/libgit2/include/git2/tree.h +55 -0
  86. data/vendor/libgit2/include/git2/version.h +4 -4
  87. data/vendor/libgit2/include/git2.h +1 -0
  88. data/vendor/libgit2/src/annotated_commit.c +99 -80
  89. data/vendor/libgit2/src/annotated_commit.h +5 -2
  90. data/vendor/libgit2/src/apply.c +377 -0
  91. data/vendor/libgit2/src/apply.h +21 -0
  92. data/vendor/libgit2/src/array.h +0 -1
  93. data/vendor/libgit2/src/blob.c +71 -39
  94. data/vendor/libgit2/src/branch.c +7 -5
  95. data/vendor/libgit2/src/buffer.c +252 -20
  96. data/vendor/libgit2/src/buffer.h +8 -0
  97. data/vendor/libgit2/src/checkout.c +69 -42
  98. data/vendor/libgit2/src/clone.c +0 -8
  99. data/vendor/libgit2/src/commit.c +193 -49
  100. data/vendor/libgit2/src/commit_list.c +8 -3
  101. data/vendor/libgit2/src/commit_list.h +1 -0
  102. data/vendor/libgit2/src/common.h +2 -1
  103. data/vendor/libgit2/src/config.c +3 -3
  104. data/vendor/libgit2/src/config_file.c +20 -10
  105. data/vendor/libgit2/src/crlf.c +1 -0
  106. data/vendor/libgit2/src/curl_stream.c +106 -6
  107. data/vendor/libgit2/src/delta.c +238 -62
  108. data/vendor/libgit2/src/delta.h +79 -58
  109. data/vendor/libgit2/src/describe.c +1 -1
  110. data/vendor/libgit2/src/diff.c +32 -1554
  111. data/vendor/libgit2/src/diff.h +14 -122
  112. data/vendor/libgit2/src/diff_driver.c +4 -6
  113. data/vendor/libgit2/src/diff_file.c +3 -0
  114. data/vendor/libgit2/src/diff_generate.c +1613 -0
  115. data/vendor/libgit2/src/diff_generate.h +123 -0
  116. data/vendor/libgit2/src/diff_parse.c +101 -0
  117. data/vendor/libgit2/src/diff_parse.h +18 -0
  118. data/vendor/libgit2/src/diff_print.c +263 -144
  119. data/vendor/libgit2/src/diff_stats.c +21 -12
  120. data/vendor/libgit2/src/diff_tform.c +1 -0
  121. data/vendor/libgit2/src/diff_tform.h +22 -0
  122. data/vendor/libgit2/src/diff_xdiff.c +9 -9
  123. data/vendor/libgit2/src/diff_xdiff.h +5 -5
  124. data/vendor/libgit2/src/fetchhead.c +8 -8
  125. data/vendor/libgit2/src/filebuf.c +6 -1
  126. data/vendor/libgit2/src/filebuf.h +1 -0
  127. data/vendor/libgit2/src/fileops.c +22 -1
  128. data/vendor/libgit2/src/fileops.h +8 -2
  129. data/vendor/libgit2/src/fnmatch.c +18 -5
  130. data/vendor/libgit2/src/global.c +21 -4
  131. data/vendor/libgit2/src/global.h +6 -0
  132. data/vendor/libgit2/src/graph.c +1 -1
  133. data/vendor/libgit2/src/index.c +159 -46
  134. data/vendor/libgit2/src/index.h +2 -0
  135. data/vendor/libgit2/src/iterator.c +1573 -1468
  136. data/vendor/libgit2/src/iterator.h +52 -69
  137. data/vendor/libgit2/src/merge.c +163 -64
  138. data/vendor/libgit2/src/merge.h +61 -2
  139. data/vendor/libgit2/src/merge_driver.c +397 -0
  140. data/vendor/libgit2/src/merge_driver.h +60 -0
  141. data/vendor/libgit2/src/merge_file.c +11 -49
  142. data/vendor/libgit2/src/netops.c +12 -10
  143. data/vendor/libgit2/src/object_api.c +19 -1
  144. data/vendor/libgit2/src/odb.c +228 -52
  145. data/vendor/libgit2/src/odb_loose.c +19 -1
  146. data/vendor/libgit2/src/odb_mempack.c +1 -1
  147. data/vendor/libgit2/src/odb_pack.c +27 -1
  148. data/vendor/libgit2/src/openssl_stream.c +4 -5
  149. data/vendor/libgit2/src/pack-objects.c +105 -76
  150. data/vendor/libgit2/src/pack-objects.h +13 -12
  151. data/vendor/libgit2/src/pack.c +16 -10
  152. data/vendor/libgit2/src/pack.h +2 -0
  153. data/vendor/libgit2/src/patch.c +216 -0
  154. data/vendor/libgit2/src/patch.h +66 -0
  155. data/vendor/libgit2/src/{diff_patch.c → patch_generate.c} +203 -376
  156. data/vendor/libgit2/src/patch_generate.h +68 -0
  157. data/vendor/libgit2/src/patch_parse.c +1159 -0
  158. data/vendor/libgit2/src/patch_parse.h +56 -0
  159. data/vendor/libgit2/src/path.c +38 -2
  160. data/vendor/libgit2/src/path.h +18 -0
  161. data/vendor/libgit2/src/pathspec.c +1 -1
  162. data/vendor/libgit2/src/pool.h +5 -0
  163. data/vendor/libgit2/src/pqueue.c +12 -5
  164. data/vendor/libgit2/src/pqueue.h +1 -0
  165. data/vendor/libgit2/src/proxy.c +32 -0
  166. data/vendor/libgit2/src/proxy.h +14 -0
  167. data/vendor/libgit2/src/push.c +1 -1
  168. data/vendor/libgit2/src/rebase.c +63 -36
  169. data/vendor/libgit2/src/refdb.c +4 -2
  170. data/vendor/libgit2/src/refdb_fs.c +82 -54
  171. data/vendor/libgit2/src/refs.c +13 -1
  172. data/vendor/libgit2/src/remote.c +20 -81
  173. data/vendor/libgit2/src/repository.c +212 -29
  174. data/vendor/libgit2/src/reset.c +1 -1
  175. data/vendor/libgit2/src/revparse.c +1 -1
  176. data/vendor/libgit2/src/revwalk.c +260 -184
  177. data/vendor/libgit2/src/settings.c +11 -3
  178. data/vendor/libgit2/src/signature.c +27 -2
  179. data/vendor/libgit2/src/sortedcache.c +14 -5
  180. data/vendor/libgit2/src/stash.c +1 -0
  181. data/vendor/libgit2/src/status.c +1 -0
  182. data/vendor/libgit2/src/stransport_stream.c +4 -2
  183. data/vendor/libgit2/src/stream.h +2 -2
  184. data/vendor/libgit2/src/submodule.c +16 -4
  185. data/vendor/libgit2/src/sysdir.c +1 -1
  186. data/vendor/libgit2/src/transport.c +3 -5
  187. data/vendor/libgit2/src/transports/http.c +38 -13
  188. data/vendor/libgit2/src/transports/local.c +4 -1
  189. data/vendor/libgit2/src/transports/smart.c +6 -0
  190. data/vendor/libgit2/src/transports/smart.h +1 -0
  191. data/vendor/libgit2/src/transports/smart_pkt.c +5 -13
  192. data/vendor/libgit2/src/transports/smart_protocol.c +22 -7
  193. data/vendor/libgit2/src/transports/winhttp.c +144 -11
  194. data/vendor/libgit2/src/tree.c +267 -2
  195. data/vendor/libgit2/src/unix/posix.h +10 -0
  196. data/vendor/libgit2/src/unix/pthread.h +2 -0
  197. data/vendor/libgit2/src/util.c +25 -2
  198. data/vendor/libgit2/src/util.h +10 -0
  199. data/vendor/libgit2/src/varint.c +44 -0
  200. data/vendor/libgit2/src/varint.h +15 -0
  201. data/vendor/libgit2/src/vector.c +58 -0
  202. data/vendor/libgit2/src/vector.h +8 -0
  203. data/vendor/libgit2/src/win32/posix.h +3 -0
  204. data/vendor/libgit2/src/win32/thread.c +18 -0
  205. data/vendor/libgit2/src/win32/thread.h +2 -0
  206. data/vendor/libgit2/src/win32/w32_util.h +1 -1
  207. data/vendor/libgit2/src/zstream.c +37 -8
  208. data/vendor/libgit2/src/zstream.h +8 -1
  209. metadata +100 -82
  210. data/vendor/libgit2/Makefile.embed +0 -60
  211. data/vendor/libgit2/src/delta-apply.c +0 -166
  212. data/vendor/libgit2/src/delta-apply.h +0 -62
  213. data/vendor/libgit2/src/diff_patch.h +0 -83
@@ -8,6 +8,7 @@
8
8
  #define INCLUDE_diff_h__
9
9
 
10
10
  #include "git2/diff.h"
11
+ #include "git2/patch.h"
11
12
  #include "git2/sys/diff.h"
12
13
  #include "git2/oid.h"
13
14
 
@@ -22,67 +23,31 @@
22
23
  #define DIFF_OLD_PREFIX_DEFAULT "a/"
23
24
  #define DIFF_NEW_PREFIX_DEFAULT "b/"
24
25
 
25
- enum {
26
- GIT_DIFFCAPS_HAS_SYMLINKS = (1 << 0), /* symlinks on platform? */
27
- GIT_DIFFCAPS_IGNORE_STAT = (1 << 1), /* use stat? */
28
- GIT_DIFFCAPS_TRUST_MODE_BITS = (1 << 2), /* use st_mode? */
29
- GIT_DIFFCAPS_TRUST_CTIME = (1 << 3), /* use st_ctime? */
30
- GIT_DIFFCAPS_USE_DEV = (1 << 4), /* use st_dev? */
31
- };
32
-
33
- #define DIFF_FLAGS_KNOWN_BINARY (GIT_DIFF_FLAG_BINARY|GIT_DIFF_FLAG_NOT_BINARY)
34
- #define DIFF_FLAGS_NOT_BINARY (GIT_DIFF_FLAG_NOT_BINARY|GIT_DIFF_FLAG__NO_DATA)
35
-
36
- enum {
37
- GIT_DIFF_FLAG__FREE_PATH = (1 << 7), /* `path` is allocated memory */
38
- GIT_DIFF_FLAG__FREE_DATA = (1 << 8), /* internal file data is allocated */
39
- GIT_DIFF_FLAG__UNMAP_DATA = (1 << 9), /* internal file data is mmap'ed */
40
- GIT_DIFF_FLAG__NO_DATA = (1 << 10), /* file data should not be loaded */
41
- GIT_DIFF_FLAG__FREE_BLOB = (1 << 11), /* release the blob when done */
42
- GIT_DIFF_FLAG__LOADED = (1 << 12), /* file data has been loaded */
43
-
44
- GIT_DIFF_FLAG__TO_DELETE = (1 << 16), /* delete entry during rename det. */
45
- GIT_DIFF_FLAG__TO_SPLIT = (1 << 17), /* split entry during rename det. */
46
- GIT_DIFF_FLAG__IS_RENAME_TARGET = (1 << 18),
47
- GIT_DIFF_FLAG__IS_RENAME_SOURCE = (1 << 19),
48
- GIT_DIFF_FLAG__HAS_SELF_SIMILARITY = (1 << 20),
49
- };
50
-
51
- #define GIT_DIFF_FLAG__CLEAR_INTERNAL(F) (F) = ((F) & 0x00FFFF)
52
-
53
- #define GIT_DIFF__VERBOSE (1 << 30)
26
+ typedef enum {
27
+ GIT_DIFF_TYPE_UNKNOWN = 0,
28
+ GIT_DIFF_TYPE_GENERATED = 1,
29
+ GIT_DIFF_TYPE_PARSED = 2,
30
+ } git_diff_origin_t;
54
31
 
55
32
  struct git_diff {
56
33
  git_refcount rc;
57
34
  git_repository *repo;
35
+ git_diff_origin_t type;
58
36
  git_diff_options opts;
59
- git_vector pathspec;
60
37
  git_vector deltas; /* vector of git_diff_delta */
61
38
  git_pool pool;
62
39
  git_iterator_type_t old_src;
63
40
  git_iterator_type_t new_src;
64
- uint32_t diffcaps;
65
41
  git_diff_perfdata perf;
66
- bool index_updated;
67
42
 
68
43
  int (*strcomp)(const char *, const char *);
69
44
  int (*strncomp)(const char *, const char *, size_t);
70
45
  int (*pfxcomp)(const char *str, const char *pfx);
71
46
  int (*entrycomp)(const void *a, const void *b);
72
- };
73
-
74
- extern void git_diff__cleanup_modes(
75
- uint32_t diffcaps, uint32_t *omode, uint32_t *nmode);
76
47
 
77
- extern void git_diff_addref(git_diff *diff);
78
-
79
- extern int git_diff_delta__cmp(const void *a, const void *b);
80
- extern int git_diff_delta__casecmp(const void *a, const void *b);
81
-
82
- extern const char *git_diff_delta__path(const git_diff_delta *delta);
83
-
84
- extern bool git_diff_delta__should_skip(
85
- const git_diff_options *opts, const git_diff_delta *delta);
48
+ int (*patch_fn)(git_patch **out, git_diff *diff, size_t idx);
49
+ void (*free_fn)(git_diff *diff);
50
+ };
86
51
 
87
52
  extern int git_diff_delta__format_file_header(
88
53
  git_buf *out,
@@ -91,84 +56,11 @@ extern int git_diff_delta__format_file_header(
91
56
  const char *newpfx,
92
57
  int oid_strlen);
93
58
 
94
- extern int git_diff__oid_for_file(
95
- git_oid *out, git_diff *, const char *, uint16_t, git_off_t);
96
- extern int git_diff__oid_for_entry(
97
- git_oid *out, git_diff *, const git_index_entry *, uint16_t, const git_oid *update);
98
-
99
- extern int git_diff__from_iterators(
100
- git_diff **diff_ptr,
101
- git_repository *repo,
102
- git_iterator *old_iter,
103
- git_iterator *new_iter,
104
- const git_diff_options *opts);
105
-
106
- extern int git_diff__paired_foreach(
107
- git_diff *idx2head,
108
- git_diff *wd2idx,
109
- int (*cb)(git_diff_delta *i2h, git_diff_delta *w2i, void *payload),
110
- void *payload);
111
-
112
- extern int git_diff_find_similar__hashsig_for_file(
113
- void **out, const git_diff_file *f, const char *path, void *p);
114
-
115
- extern int git_diff_find_similar__hashsig_for_buf(
116
- void **out, const git_diff_file *f, const char *buf, size_t len, void *p);
117
-
118
- extern void git_diff_find_similar__hashsig_free(void *sig, void *payload);
119
-
120
- extern int git_diff_find_similar__calc_similarity(
121
- int *score, void *siga, void *sigb, void *payload);
122
-
123
- extern int git_diff__commit(
124
- git_diff **diff, git_repository *repo, const git_commit *commit, const git_diff_options *opts);
125
-
126
- /* Merge two `git_diff`s according to the callback given by `cb`. */
127
-
128
- typedef git_diff_delta *(*git_diff__merge_cb)(
129
- const git_diff_delta *left,
130
- const git_diff_delta *right,
131
- git_pool *pool);
132
-
133
- extern int git_diff__merge(
134
- git_diff *onto, const git_diff *from, git_diff__merge_cb cb);
135
-
136
- extern git_diff_delta *git_diff__merge_like_cgit(
137
- const git_diff_delta *a,
138
- const git_diff_delta *b,
139
- git_pool *pool);
140
-
141
- /* Duplicate a `git_diff_delta` out of the `git_pool` */
142
- extern git_diff_delta *git_diff__delta_dup(
143
- const git_diff_delta *d, git_pool *pool);
144
-
145
- /*
146
- * Sometimes a git_diff_file will have a zero size; this attempts to
147
- * fill in the size without loading the blob if possible. If that is
148
- * not possible, then it will return the git_odb_object that had to be
149
- * loaded and the caller can use it or dispose of it as needed.
150
- */
151
- GIT_INLINE(int) git_diff_file__resolve_zero_size(
152
- git_diff_file *file, git_odb_object **odb_obj, git_repository *repo)
153
- {
154
- int error;
155
- git_odb *odb;
156
- size_t len;
157
- git_otype type;
158
-
159
- if ((error = git_repository_odb(&odb, repo)) < 0)
160
- return error;
161
-
162
- error = git_odb__read_header_or_object(
163
- odb_obj, &len, &type, odb, &file->id);
164
-
165
- git_odb_free(odb);
166
-
167
- if (!error)
168
- file->size = (git_off_t)len;
59
+ extern int git_diff_delta__cmp(const void *a, const void *b);
60
+ extern int git_diff_delta__casecmp(const void *a, const void *b);
169
61
 
170
- return error;
171
- }
62
+ extern int git_diff__entry_cmp(const void *a, const void *b);
63
+ extern int git_diff__entry_icmp(const void *a, const void *b);
172
64
 
173
65
  #endif
174
66
 
@@ -9,7 +9,6 @@
9
9
  #include "git2/attr.h"
10
10
 
11
11
  #include "diff.h"
12
- #include "diff_patch.h"
13
12
  #include "diff_driver.h"
14
13
  #include "strmap.h"
15
14
  #include "map.h"
@@ -59,7 +58,7 @@ static git_diff_driver global_drivers[3] = {
59
58
  { DIFF_DRIVER_TEXT, GIT_DIFF_FORCE_TEXT, 0 },
60
59
  };
61
60
 
62
- git_diff_driver_registry *git_diff_driver_registry_new()
61
+ git_diff_driver_registry *git_diff_driver_registry_new(void)
63
62
  {
64
63
  git_diff_driver_registry *reg =
65
64
  git__calloc(1, sizeof(git_diff_driver_registry));
@@ -115,7 +114,7 @@ static int diff_driver_add_patterns(
115
114
  if (error < 0)
116
115
  break;
117
116
 
118
- if ((error = regcomp(&pat->re, buf.ptr, regex_flags)) != 0) {
117
+ if ((error = p_regcomp(&pat->re, buf.ptr, regex_flags)) != 0) {
119
118
  /*
120
119
  * TODO: issue a warning
121
120
  */
@@ -211,7 +210,7 @@ static int git_diff_driver_builtin(
211
210
  goto done;
212
211
 
213
212
  if (ddef->words &&
214
- (error = regcomp(
213
+ (error = p_regcomp(
215
214
  &drv->word_pattern, ddef->words, ddef->flags | REG_EXTENDED)))
216
215
  {
217
216
  error = giterr_set_regex(&drv->word_pattern, error);
@@ -315,7 +314,7 @@ static int git_diff_driver_load(
315
314
  goto done;
316
315
  if (!ce || !ce->value)
317
316
  /* no diff.<driver>.wordregex, so just continue */;
318
- else if (!(error = regcomp(&drv->word_pattern, ce->value, REG_EXTENDED)))
317
+ else if (!(error = p_regcomp(&drv->word_pattern, ce->value, REG_EXTENDED)))
319
318
  found_driver = true;
320
319
  else {
321
320
  /* TODO: warn about bad regex instead of failure */
@@ -520,4 +519,3 @@ void git_diff_find_context_clear(git_diff_find_context_payload *payload)
520
519
  payload->driver = NULL;
521
520
  }
522
521
  }
523
-
@@ -8,6 +8,7 @@
8
8
  #include "git2/blob.h"
9
9
  #include "git2/submodule.h"
10
10
  #include "diff.h"
11
+ #include "diff_generate.h"
11
12
  #include "diff_file.h"
12
13
  #include "odb.h"
13
14
  #include "fileops.h"
@@ -149,12 +150,14 @@ int git_diff_file_content__init_from_src(
149
150
  if (src->blob) {
150
151
  fc->file->size = git_blob_rawsize(src->blob);
151
152
  git_oid_cpy(&fc->file->id, git_blob_id(src->blob));
153
+ fc->file->id_abbrev = GIT_OID_HEXSZ;
152
154
 
153
155
  fc->map.len = (size_t)fc->file->size;
154
156
  fc->map.data = (char *)git_blob_rawcontent(src->blob);
155
157
  } else {
156
158
  fc->file->size = src->buflen;
157
159
  git_odb_hash(&fc->file->id, src->buf, src->buflen, GIT_OBJ_BLOB);
160
+ fc->file->id_abbrev = GIT_OID_HEXSZ;
158
161
 
159
162
  fc->map.len = src->buflen;
160
163
  fc->map.data = (char *)src->buf;