rugged 0.26.3 → 0.26.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rugged/version.rb +1 -1
- data/vendor/libgit2/CMakeLists.txt +1 -1
- data/vendor/libgit2/deps/winhttp/winhttp.h +6 -4
- data/vendor/libgit2/deps/zlib/adler32.c +14 -7
- data/vendor/libgit2/deps/zlib/crc32.c +29 -12
- data/vendor/libgit2/deps/zlib/deflate.c +499 -303
- data/vendor/libgit2/deps/zlib/deflate.h +18 -15
- data/vendor/libgit2/deps/zlib/gzguts.h +218 -0
- data/vendor/libgit2/deps/zlib/infback.c +2 -2
- data/vendor/libgit2/deps/zlib/inffast.c +34 -51
- data/vendor/libgit2/deps/zlib/inflate.c +86 -37
- data/vendor/libgit2/deps/zlib/inflate.h +7 -4
- data/vendor/libgit2/deps/zlib/inftrees.c +12 -14
- data/vendor/libgit2/deps/zlib/trees.c +38 -61
- data/vendor/libgit2/deps/zlib/zconf.h +499 -23
- data/vendor/libgit2/deps/zlib/zlib.h +298 -154
- data/vendor/libgit2/deps/zlib/zutil.c +27 -23
- data/vendor/libgit2/deps/zlib/zutil.h +35 -17
- data/vendor/libgit2/include/git2.h +1 -0
- data/vendor/libgit2/include/git2/sys/mempack.h +5 -4
- data/vendor/libgit2/include/git2/version.h +2 -2
- data/vendor/libgit2/src/checkout.c +34 -11
- data/vendor/libgit2/src/curl_stream.c +21 -0
- data/vendor/libgit2/src/curl_stream.h +1 -0
- data/vendor/libgit2/src/delta.c +30 -28
- data/vendor/libgit2/src/diff.c +0 -7
- data/vendor/libgit2/src/diff_file.c +3 -1
- data/vendor/libgit2/src/diff_generate.c +1 -1
- data/vendor/libgit2/src/diff_tform.c +3 -1
- data/vendor/libgit2/src/global.c +4 -2
- data/vendor/libgit2/src/hash/hash_openssl.h +18 -3
- data/vendor/libgit2/src/ignore.c +60 -36
- data/vendor/libgit2/src/index.c +59 -26
- data/vendor/libgit2/src/indexer.c +15 -2
- data/vendor/libgit2/src/merge.c +18 -8
- data/vendor/libgit2/src/odb_mempack.c +1 -0
- data/vendor/libgit2/src/oidarray.c +12 -0
- data/vendor/libgit2/src/oidarray.h +1 -0
- data/vendor/libgit2/src/openssl_stream.c +17 -4
- data/vendor/libgit2/src/pack.c +10 -7
- data/vendor/libgit2/src/path.c +180 -22
- data/vendor/libgit2/src/path.h +73 -0
- data/vendor/libgit2/src/posix.c +1 -1
- data/vendor/libgit2/src/posix.h +3 -0
- data/vendor/libgit2/src/proxy.c +6 -0
- data/vendor/libgit2/src/proxy.h +1 -0
- data/vendor/libgit2/src/push.c +3 -0
- data/vendor/libgit2/src/refdb_fs.c +2 -2
- data/vendor/libgit2/src/refs.c +7 -1
- data/vendor/libgit2/src/repository.c +9 -3
- data/vendor/libgit2/src/sha1_lookup.c +2 -2
- data/vendor/libgit2/src/signature.c +1 -0
- data/vendor/libgit2/src/socket_stream.c +1 -1
- data/vendor/libgit2/src/stransport_stream.c +3 -1
- data/vendor/libgit2/src/submodule.c +54 -7
- data/vendor/libgit2/src/submodule.h +13 -0
- data/vendor/libgit2/src/transports/smart_pkt.c +8 -2
- data/vendor/libgit2/src/transports/smart_protocol.c +6 -6
- data/vendor/libgit2/src/transports/winhttp.c +22 -0
- data/vendor/libgit2/src/tree.c +1 -1
- metadata +3 -2
@@ -843,6 +843,7 @@ static int fix_thin_pack(git_indexer *idx, git_transfer_progress *stats)
|
|
843
843
|
static int resolve_deltas(git_indexer *idx, git_transfer_progress *stats)
|
844
844
|
{
|
845
845
|
unsigned int i;
|
846
|
+
int error;
|
846
847
|
struct delta_info *delta;
|
847
848
|
int progressed = 0, non_null = 0, progress_cb_result;
|
848
849
|
|
@@ -857,8 +858,13 @@ static int resolve_deltas(git_indexer *idx, git_transfer_progress *stats)
|
|
857
858
|
|
858
859
|
non_null = 1;
|
859
860
|
idx->off = delta->delta_off;
|
860
|
-
if (git_packfile_unpack(&obj, idx->pack, &idx->off) < 0)
|
861
|
-
|
861
|
+
if ((error = git_packfile_unpack(&obj, idx->pack, &idx->off)) < 0) {
|
862
|
+
if (error == GIT_PASSTHROUGH) {
|
863
|
+
/* We have not seen the base object, we'll try again later. */
|
864
|
+
continue;
|
865
|
+
}
|
866
|
+
return -1;
|
867
|
+
}
|
862
868
|
|
863
869
|
if (hash_and_save(idx, &obj, delta->delta_off) < 0)
|
864
870
|
continue;
|
@@ -950,6 +956,10 @@ int git_indexer_commit(git_indexer *idx, git_transfer_progress *stats)
|
|
950
956
|
giterr_set(GITERR_INDEXER, "unexpected data at the end of the pack");
|
951
957
|
return -1;
|
952
958
|
}
|
959
|
+
if (idx->off + 20 > idx->pack->mwf.size) {
|
960
|
+
giterr_set(GITERR_INDEXER, "missing trailer at the end of the pack");
|
961
|
+
return -1;
|
962
|
+
}
|
953
963
|
|
954
964
|
packfile_trailer = git_mwindow_open(&idx->pack->mwf, &w, idx->pack->mwf.size - GIT_OID_RAWSZ, GIT_OID_RAWSZ, &left);
|
955
965
|
if (packfile_trailer == NULL) {
|
@@ -1118,6 +1128,9 @@ void git_indexer_free(git_indexer *idx)
|
|
1118
1128
|
if (idx == NULL)
|
1119
1129
|
return;
|
1120
1130
|
|
1131
|
+
if (idx->have_stream)
|
1132
|
+
git_packfile_stream_free(&idx->stream);
|
1133
|
+
|
1121
1134
|
git_vector_free_deep(&idx->objects);
|
1122
1135
|
|
1123
1136
|
if (idx->pack->idx_cache) {
|
data/vendor/libgit2/src/merge.c
CHANGED
@@ -2141,7 +2141,7 @@ static int compute_base(
|
|
2141
2141
|
git_oidarray bases = {0};
|
2142
2142
|
git_annotated_commit *base = NULL, *other = NULL, *new_base = NULL;
|
2143
2143
|
git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
|
2144
|
-
size_t i;
|
2144
|
+
size_t i, base_count;
|
2145
2145
|
int error;
|
2146
2146
|
|
2147
2147
|
*out = NULL;
|
@@ -2149,17 +2149,27 @@ static int compute_base(
|
|
2149
2149
|
if (given_opts)
|
2150
2150
|
memcpy(&opts, given_opts, sizeof(git_merge_options));
|
2151
2151
|
|
2152
|
-
|
2153
|
-
|
2152
|
+
/* With more than two commits, merge_bases_many finds the base of
|
2153
|
+
* the first commit and a hypothetical merge of the others. Since
|
2154
|
+
* "one" may itself be a virtual commit, which insert_head_ids
|
2155
|
+
* substitutes multiple ancestors for, it needs to be added
|
2156
|
+
* after "two" which is always a single real commit.
|
2157
|
+
*/
|
2158
|
+
if ((error = insert_head_ids(&head_ids, two)) < 0 ||
|
2159
|
+
(error = insert_head_ids(&head_ids, one)) < 0 ||
|
2160
|
+
(error = git_merge_bases_many(&bases, repo,
|
2161
|
+
head_ids.size, head_ids.ptr)) < 0)
|
2154
2162
|
goto done;
|
2155
2163
|
|
2156
|
-
|
2157
|
-
|
2158
|
-
|
2159
|
-
(
|
2164
|
+
base_count = (opts.flags & GIT_MERGE_NO_RECURSIVE) ? 0 : bases.count;
|
2165
|
+
|
2166
|
+
if (base_count)
|
2167
|
+
git_oidarray__reverse(&bases);
|
2168
|
+
|
2169
|
+
if ((error = git_annotated_commit_lookup(&base, repo, &bases.ids[0])) < 0)
|
2160
2170
|
goto done;
|
2161
2171
|
|
2162
|
-
for (i = 1; i <
|
2172
|
+
for (i = 1; i < base_count; i++) {
|
2163
2173
|
recursion_level++;
|
2164
2174
|
|
2165
2175
|
if (opts.recursion_limit && recursion_level > opts.recursion_limit)
|
@@ -19,3 +19,15 @@ void git_oidarray__from_array(git_oidarray *arr, git_array_oid_t *array)
|
|
19
19
|
arr->count = array->size;
|
20
20
|
arr->ids = array->ptr;
|
21
21
|
}
|
22
|
+
|
23
|
+
void git_oidarray__reverse(git_oidarray *arr)
|
24
|
+
{
|
25
|
+
size_t i;
|
26
|
+
git_oid tmp;
|
27
|
+
|
28
|
+
for (i = 0; i < arr->count / 2; i++) {
|
29
|
+
git_oid_cpy(&tmp, &arr->ids[i]);
|
30
|
+
git_oid_cpy(&arr->ids[i], &arr->ids[(arr->count-1)-i]);
|
31
|
+
git_oid_cpy(&arr->ids[(arr->count-1)-i], &tmp);
|
32
|
+
}
|
33
|
+
}
|
@@ -149,11 +149,20 @@ int git_openssl_stream_global_init(void)
|
|
149
149
|
return 0;
|
150
150
|
}
|
151
151
|
|
152
|
+
#if defined(GIT_THREADS)
|
153
|
+
static void threadid_cb(CRYPTO_THREADID *threadid)
|
154
|
+
{
|
155
|
+
CRYPTO_THREADID_set_numeric(threadid, git_thread_currentid());
|
156
|
+
}
|
157
|
+
#endif
|
158
|
+
|
152
159
|
int git_openssl_set_locking(void)
|
153
160
|
{
|
154
161
|
#if defined(GIT_THREADS) && OPENSSL_VERSION_NUMBER < 0x10100000L
|
155
162
|
int num_locks, i;
|
156
163
|
|
164
|
+
CRYPTO_THREADID_set_callback(threadid_cb);
|
165
|
+
|
157
166
|
num_locks = CRYPTO_num_locks();
|
158
167
|
openssl_locks = git__calloc(num_locks, sizeof(git_mutex));
|
159
168
|
GITERR_CHECK_ALLOC(openssl_locks);
|
@@ -272,8 +281,9 @@ static int ssl_set_error(SSL *ssl, int error)
|
|
272
281
|
case SSL_ERROR_SYSCALL:
|
273
282
|
e = ERR_get_error();
|
274
283
|
if (e > 0) {
|
275
|
-
|
276
|
-
|
284
|
+
char errmsg[256];
|
285
|
+
ERR_error_string_n(e, errmsg, sizeof(errmsg));
|
286
|
+
giterr_set(GITERR_NET, "SSL error: %s", errmsg);
|
277
287
|
break;
|
278
288
|
} else if (error < 0) {
|
279
289
|
giterr_set(GITERR_OS, "SSL error: syscall failure");
|
@@ -283,10 +293,13 @@ static int ssl_set_error(SSL *ssl, int error)
|
|
283
293
|
return GIT_EEOF;
|
284
294
|
break;
|
285
295
|
case SSL_ERROR_SSL:
|
296
|
+
{
|
297
|
+
char errmsg[256];
|
286
298
|
e = ERR_get_error();
|
287
|
-
|
288
|
-
|
299
|
+
ERR_error_string_n(e, errmsg, sizeof(errmsg));
|
300
|
+
giterr_set(GITERR_NET, "SSL error: %s", errmsg);
|
289
301
|
break;
|
302
|
+
}
|
290
303
|
case SSL_ERROR_NONE:
|
291
304
|
case SSL_ERROR_ZERO_RETURN:
|
292
305
|
default:
|
data/vendor/libgit2/src/pack.c
CHANGED
@@ -716,8 +716,11 @@ int git_packfile_unpack(
|
|
716
716
|
error = packfile_unpack_compressed(&delta, p, &w_curs, &curpos, elem->size, elem->type);
|
717
717
|
git_mwindow_close(&w_curs);
|
718
718
|
|
719
|
-
if (error < 0)
|
719
|
+
if (error < 0) {
|
720
|
+
/* We have transferred ownership of the data to the cache. */
|
721
|
+
obj->data = NULL;
|
720
722
|
break;
|
723
|
+
}
|
721
724
|
|
722
725
|
/* the current object becomes the new base, on which we apply the delta */
|
723
726
|
base = *obj;
|
@@ -934,19 +937,19 @@ git_off_t get_delta_base(
|
|
934
937
|
if (type == GIT_OBJ_OFS_DELTA) {
|
935
938
|
unsigned used = 0;
|
936
939
|
unsigned char c = base_info[used++];
|
937
|
-
|
940
|
+
size_t unsigned_base_offset = c & 127;
|
938
941
|
while (c & 128) {
|
939
942
|
if (left <= used)
|
940
943
|
return GIT_EBUFS;
|
941
|
-
|
942
|
-
if (!
|
944
|
+
unsigned_base_offset += 1;
|
945
|
+
if (!unsigned_base_offset || MSB(unsigned_base_offset, 7))
|
943
946
|
return 0; /* overflow */
|
944
947
|
c = base_info[used++];
|
945
|
-
|
948
|
+
unsigned_base_offset = (unsigned_base_offset << 7) + (c & 127);
|
946
949
|
}
|
947
|
-
|
948
|
-
if (base_offset <= 0 || base_offset >= delta_obj_offset)
|
950
|
+
if (unsigned_base_offset == 0 || (size_t)delta_obj_offset <= unsigned_base_offset)
|
949
951
|
return 0; /* out of bound */
|
952
|
+
base_offset = delta_obj_offset - unsigned_base_offset;
|
950
953
|
*curpos += used;
|
951
954
|
} else if (type == GIT_OBJ_REF_DELTA) {
|
952
955
|
/* If we have the cooperative cache, search in it first */
|
data/vendor/libgit2/src/path.c
CHANGED
@@ -1560,18 +1560,31 @@ static int32_t next_hfs_char(const char **in, size_t *len)
|
|
1560
1560
|
return 0; /* NULL byte -- end of string */
|
1561
1561
|
}
|
1562
1562
|
|
1563
|
-
static bool
|
1563
|
+
static bool verify_dotgit_hfs_generic(const char *path, size_t len, const char *needle, size_t needle_len)
|
1564
1564
|
{
|
1565
|
-
|
1566
|
-
|
1567
|
-
|
1568
|
-
|
1569
|
-
|
1565
|
+
size_t i;
|
1566
|
+
char c;
|
1567
|
+
|
1568
|
+
if (next_hfs_char(&path, &len) != '.')
|
1569
|
+
return true;
|
1570
|
+
|
1571
|
+
for (i = 0; i < needle_len; i++) {
|
1572
|
+
c = next_hfs_char(&path, &len);
|
1573
|
+
if (c != needle[i])
|
1574
|
+
return true;
|
1575
|
+
}
|
1576
|
+
|
1577
|
+
if (next_hfs_char(&path, &len) != '\0')
|
1570
1578
|
return true;
|
1571
1579
|
|
1572
1580
|
return false;
|
1573
1581
|
}
|
1574
1582
|
|
1583
|
+
static bool verify_dotgit_hfs(const char *path, size_t len)
|
1584
|
+
{
|
1585
|
+
return verify_dotgit_hfs_generic(path, len, "git", CONST_STRLEN("git"));
|
1586
|
+
}
|
1587
|
+
|
1575
1588
|
GIT_INLINE(bool) verify_dotgit_ntfs(git_repository *repo, const char *path, size_t len)
|
1576
1589
|
{
|
1577
1590
|
git_buf *reserved = git_repository__reserved_names_win32;
|
@@ -1607,6 +1620,57 @@ GIT_INLINE(bool) verify_dotgit_ntfs(git_repository *repo, const char *path, size
|
|
1607
1620
|
return false;
|
1608
1621
|
}
|
1609
1622
|
|
1623
|
+
GIT_INLINE(bool) only_spaces_and_dots(const char *path)
|
1624
|
+
{
|
1625
|
+
const char *c = path;
|
1626
|
+
|
1627
|
+
for (;; c++) {
|
1628
|
+
if (*c == '\0')
|
1629
|
+
return true;
|
1630
|
+
if (*c != ' ' && *c != '.')
|
1631
|
+
return false;
|
1632
|
+
}
|
1633
|
+
|
1634
|
+
return true;
|
1635
|
+
}
|
1636
|
+
|
1637
|
+
GIT_INLINE(bool) verify_dotgit_ntfs_generic(const char *name, size_t len, const char *dotgit_name, size_t dotgit_len, const char *shortname_pfix)
|
1638
|
+
{
|
1639
|
+
int i, saw_tilde;
|
1640
|
+
|
1641
|
+
if (name[0] == '.' && len >= dotgit_len &&
|
1642
|
+
!strncasecmp(name + 1, dotgit_name, dotgit_len)) {
|
1643
|
+
return !only_spaces_and_dots(name + dotgit_len + 1);
|
1644
|
+
}
|
1645
|
+
|
1646
|
+
/* Detect the basic NTFS shortname with the first six chars */
|
1647
|
+
if (!strncasecmp(name, dotgit_name, 6) && name[6] == '~' &&
|
1648
|
+
name[7] >= '1' && name[7] <= '4')
|
1649
|
+
return !only_spaces_and_dots(name + 8);
|
1650
|
+
|
1651
|
+
/* Catch fallback names */
|
1652
|
+
for (i = 0, saw_tilde = 0; i < 8; i++) {
|
1653
|
+
if (name[i] == '\0') {
|
1654
|
+
return true;
|
1655
|
+
} else if (saw_tilde) {
|
1656
|
+
if (name[i] < '0' || name[i] > '9')
|
1657
|
+
return true;
|
1658
|
+
} else if (name[i] == '~') {
|
1659
|
+
if (name[i+1] < '1' || name[i+1] > '9')
|
1660
|
+
return true;
|
1661
|
+
saw_tilde = 1;
|
1662
|
+
} else if (i >= 6) {
|
1663
|
+
return true;
|
1664
|
+
} else if (name[i] < 0) {
|
1665
|
+
return true;
|
1666
|
+
} else if (git__tolower(name[i]) != shortname_pfix[i]) {
|
1667
|
+
return true;
|
1668
|
+
}
|
1669
|
+
}
|
1670
|
+
|
1671
|
+
return !only_spaces_and_dots(name + i);
|
1672
|
+
}
|
1673
|
+
|
1610
1674
|
GIT_INLINE(bool) verify_char(unsigned char c, unsigned int flags)
|
1611
1675
|
{
|
1612
1676
|
if ((flags & GIT_PATH_REJECT_BACKSLASH) && c == '\\')
|
@@ -1634,6 +1698,24 @@ GIT_INLINE(bool) verify_char(unsigned char c, unsigned int flags)
|
|
1634
1698
|
return true;
|
1635
1699
|
}
|
1636
1700
|
|
1701
|
+
/*
|
1702
|
+
* Return the length of the common prefix between str and prefix, comparing them
|
1703
|
+
* case-insensitively (must be ASCII to match).
|
1704
|
+
*/
|
1705
|
+
GIT_INLINE(size_t) common_prefix_icase(const char *str, size_t len, const char *prefix)
|
1706
|
+
{
|
1707
|
+
size_t count = 0;
|
1708
|
+
|
1709
|
+
while (len >0 && tolower(*str) == tolower(*prefix)) {
|
1710
|
+
count++;
|
1711
|
+
str++;
|
1712
|
+
prefix++;
|
1713
|
+
len--;
|
1714
|
+
}
|
1715
|
+
|
1716
|
+
return count;
|
1717
|
+
}
|
1718
|
+
|
1637
1719
|
/*
|
1638
1720
|
* We fundamentally don't like some paths when dealing with user-inputted
|
1639
1721
|
* strings (in checkout or ref names): we don't want dot or dot-dot
|
@@ -1647,6 +1729,7 @@ static bool verify_component(
|
|
1647
1729
|
git_repository *repo,
|
1648
1730
|
const char *component,
|
1649
1731
|
size_t len,
|
1732
|
+
uint16_t mode,
|
1650
1733
|
unsigned int flags)
|
1651
1734
|
{
|
1652
1735
|
if (len == 0)
|
@@ -1679,26 +1762,38 @@ static bool verify_component(
|
|
1679
1762
|
return false;
|
1680
1763
|
}
|
1681
1764
|
|
1682
|
-
if (flags & GIT_PATH_REJECT_DOT_GIT_HFS
|
1683
|
-
!verify_dotgit_hfs(component, len))
|
1684
|
-
|
1765
|
+
if (flags & GIT_PATH_REJECT_DOT_GIT_HFS) {
|
1766
|
+
if (!verify_dotgit_hfs(component, len))
|
1767
|
+
return false;
|
1768
|
+
if (S_ISLNK(mode) && git_path_is_hfs_dotgit_modules(component, len))
|
1769
|
+
return false;
|
1770
|
+
}
|
1685
1771
|
|
1686
|
-
if (flags & GIT_PATH_REJECT_DOT_GIT_NTFS
|
1687
|
-
!verify_dotgit_ntfs(repo, component, len))
|
1688
|
-
|
1772
|
+
if (flags & GIT_PATH_REJECT_DOT_GIT_NTFS) {
|
1773
|
+
if (!verify_dotgit_ntfs(repo, component, len))
|
1774
|
+
return false;
|
1775
|
+
if (S_ISLNK(mode) && git_path_is_ntfs_dotgit_modules(component, len))
|
1776
|
+
return false;
|
1777
|
+
}
|
1689
1778
|
|
1690
1779
|
/* don't bother rerunning the `.git` test if we ran the HFS or NTFS
|
1691
1780
|
* specific tests, they would have already rejected `.git`.
|
1692
1781
|
*/
|
1693
1782
|
if ((flags & GIT_PATH_REJECT_DOT_GIT_HFS) == 0 &&
|
1694
|
-
|
1695
|
-
|
1696
|
-
len
|
1697
|
-
|
1698
|
-
|
1699
|
-
|
1700
|
-
|
1701
|
-
|
1783
|
+
(flags & GIT_PATH_REJECT_DOT_GIT_NTFS) == 0 &&
|
1784
|
+
(flags & GIT_PATH_REJECT_DOT_GIT_LITERAL)) {
|
1785
|
+
if (len >= 4 &&
|
1786
|
+
component[0] == '.' &&
|
1787
|
+
(component[1] == 'g' || component[1] == 'G') &&
|
1788
|
+
(component[2] == 'i' || component[2] == 'I') &&
|
1789
|
+
(component[3] == 't' || component[3] == 'T')) {
|
1790
|
+
if (len == 4)
|
1791
|
+
return false;
|
1792
|
+
|
1793
|
+
if (S_ISLNK(mode) && common_prefix_icase(component, len, ".gitmodules") == len)
|
1794
|
+
return false;
|
1795
|
+
}
|
1796
|
+
}
|
1702
1797
|
|
1703
1798
|
return true;
|
1704
1799
|
}
|
@@ -1736,6 +1831,7 @@ GIT_INLINE(unsigned int) dotgit_flags(
|
|
1736
1831
|
bool git_path_isvalid(
|
1737
1832
|
git_repository *repo,
|
1738
1833
|
const char *path,
|
1834
|
+
uint16_t mode,
|
1739
1835
|
unsigned int flags)
|
1740
1836
|
{
|
1741
1837
|
const char *start, *c;
|
@@ -1749,14 +1845,14 @@ bool git_path_isvalid(
|
|
1749
1845
|
return false;
|
1750
1846
|
|
1751
1847
|
if (*c == '/') {
|
1752
|
-
if (!verify_component(repo, start, (c - start), flags))
|
1848
|
+
if (!verify_component(repo, start, (c - start), mode, flags))
|
1753
1849
|
return false;
|
1754
1850
|
|
1755
1851
|
start = c+1;
|
1756
1852
|
}
|
1757
1853
|
}
|
1758
1854
|
|
1759
|
-
return verify_component(repo, start, (c - start), flags);
|
1855
|
+
return verify_component(repo, start, (c - start), mode, flags);
|
1760
1856
|
}
|
1761
1857
|
|
1762
1858
|
int git_path_normalize_slashes(git_buf *out, const char *path)
|
@@ -1774,3 +1870,65 @@ int git_path_normalize_slashes(git_buf *out, const char *path)
|
|
1774
1870
|
|
1775
1871
|
return 0;
|
1776
1872
|
}
|
1873
|
+
|
1874
|
+
static int verify_dotgit_generic(const char *name, size_t len, const char *dotgit_name, size_t dotgit_len, const char *shortname_pfix)
|
1875
|
+
{
|
1876
|
+
if (!verify_dotgit_ntfs_generic(name, len, dotgit_name, dotgit_len, shortname_pfix))
|
1877
|
+
return false;
|
1878
|
+
|
1879
|
+
return verify_dotgit_hfs_generic(name, len, dotgit_name, dotgit_len);
|
1880
|
+
}
|
1881
|
+
|
1882
|
+
int git_path_is_ntfs_dotgit_modules(const char *name, size_t len)
|
1883
|
+
{
|
1884
|
+
return !verify_dotgit_ntfs_generic(name, len, "gitmodules", CONST_STRLEN("gitmodules"), "gi7eba");
|
1885
|
+
}
|
1886
|
+
|
1887
|
+
int git_path_is_hfs_dotgit_modules(const char *name, size_t len)
|
1888
|
+
{
|
1889
|
+
return !verify_dotgit_hfs_generic(name, len, "gitmodules", CONST_STRLEN("gitmodules"));
|
1890
|
+
}
|
1891
|
+
|
1892
|
+
int git_path_is_dotgit_modules(const char *name, size_t len)
|
1893
|
+
{
|
1894
|
+
if (git_path_is_hfs_dotgit_modules(name, len))
|
1895
|
+
return 1;
|
1896
|
+
|
1897
|
+
return git_path_is_ntfs_dotgit_modules(name, len);
|
1898
|
+
}
|
1899
|
+
|
1900
|
+
int git_path_is_ntfs_dotgit_ignore(const char *name, size_t len)
|
1901
|
+
{
|
1902
|
+
return !verify_dotgit_ntfs_generic(name, len, "gitignore", CONST_STRLEN("gitignore"), "gi250a");
|
1903
|
+
}
|
1904
|
+
|
1905
|
+
int git_path_is_hfs_dotgit_ignore(const char *name, size_t len)
|
1906
|
+
{
|
1907
|
+
return !verify_dotgit_hfs_generic(name, len, "gitignore", CONST_STRLEN("gitignore"));
|
1908
|
+
}
|
1909
|
+
|
1910
|
+
int git_path_is_dotgit_ignore(const char *name, size_t len)
|
1911
|
+
{
|
1912
|
+
if (git_path_is_hfs_dotgit_ignore(name, len))
|
1913
|
+
return 1;
|
1914
|
+
|
1915
|
+
return git_path_is_ntfs_dotgit_ignore(name, len);
|
1916
|
+
}
|
1917
|
+
|
1918
|
+
int git_path_is_hfs_dotgit_attributes(const char *name, size_t len)
|
1919
|
+
{
|
1920
|
+
return !verify_dotgit_hfs_generic(name, len, "gitattributes", CONST_STRLEN("gitattributes"));
|
1921
|
+
}
|
1922
|
+
|
1923
|
+
int git_path_is_ntfs_dotgit_attributes(const char *name, size_t len)
|
1924
|
+
{
|
1925
|
+
return !verify_dotgit_ntfs_generic(name, len, "gitattributes", CONST_STRLEN("gitattributes"), "gi7d29");
|
1926
|
+
}
|
1927
|
+
|
1928
|
+
int git_path_is_dotgit_attributes(const char *name, size_t len)
|
1929
|
+
{
|
1930
|
+
if (git_path_is_hfs_dotgit_attributes(name, len))
|
1931
|
+
return 1;
|
1932
|
+
|
1933
|
+
return git_path_is_ntfs_dotgit_attributes(name, len);
|
1934
|
+
}
|