rugged 0.25.0b5 → 0.25.0b6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/ext/rugged/rugged_patch.c +77 -17
  3. data/lib/rugged/version.rb +1 -1
  4. data/vendor/libgit2/CMakeLists.txt +8 -6
  5. data/vendor/libgit2/include/git2/checkout.h +7 -0
  6. data/vendor/libgit2/include/git2/common.h +1 -0
  7. data/vendor/libgit2/include/git2/diff.h +54 -7
  8. data/vendor/libgit2/include/git2/errors.h +2 -1
  9. data/vendor/libgit2/include/git2/index.h +25 -0
  10. data/vendor/libgit2/include/git2/pack.h +4 -4
  11. data/vendor/libgit2/include/git2/repository.h +20 -1
  12. data/vendor/libgit2/include/git2/submodule.h +11 -3
  13. data/vendor/libgit2/include/git2/sys/odb_backend.h +11 -0
  14. data/vendor/libgit2/src/apply.c +369 -0
  15. data/vendor/libgit2/src/apply.h +21 -0
  16. data/vendor/libgit2/src/array.h +0 -1
  17. data/vendor/libgit2/src/blame_git.c +18 -8
  18. data/vendor/libgit2/src/buffer.c +252 -20
  19. data/vendor/libgit2/src/buffer.h +8 -0
  20. data/vendor/libgit2/src/checkout.c +7 -1
  21. data/vendor/libgit2/src/clone.c +0 -8
  22. data/vendor/libgit2/src/common.h +1 -1
  23. data/vendor/libgit2/src/crlf.c +1 -0
  24. data/vendor/libgit2/src/delta.c +238 -62
  25. data/vendor/libgit2/src/delta.h +79 -58
  26. data/vendor/libgit2/src/diff.c +32 -1547
  27. data/vendor/libgit2/src/diff.h +12 -122
  28. data/vendor/libgit2/src/diff_driver.c +1 -2
  29. data/vendor/libgit2/src/diff_file.c +3 -0
  30. data/vendor/libgit2/src/diff_generate.c +1611 -0
  31. data/vendor/libgit2/src/diff_generate.h +123 -0
  32. data/vendor/libgit2/src/diff_parse.c +105 -0
  33. data/vendor/libgit2/src/diff_print.c +259 -142
  34. data/vendor/libgit2/src/diff_stats.c +3 -2
  35. data/vendor/libgit2/src/diff_tform.c +1 -0
  36. data/vendor/libgit2/src/diff_tform.h +22 -0
  37. data/vendor/libgit2/src/diff_xdiff.c +9 -9
  38. data/vendor/libgit2/src/diff_xdiff.h +5 -5
  39. data/vendor/libgit2/src/fileops.c +13 -0
  40. data/vendor/libgit2/src/fileops.h +6 -0
  41. data/vendor/libgit2/src/global.c +9 -8
  42. data/vendor/libgit2/src/ignore.c +45 -16
  43. data/vendor/libgit2/src/index.c +161 -47
  44. data/vendor/libgit2/src/index.h +2 -0
  45. data/vendor/libgit2/src/merge.c +2 -0
  46. data/vendor/libgit2/src/mwindow.c +8 -19
  47. data/vendor/libgit2/src/mwindow.h +1 -2
  48. data/vendor/libgit2/src/odb.c +46 -10
  49. data/vendor/libgit2/src/odb_loose.c +19 -1
  50. data/vendor/libgit2/src/odb_pack.c +27 -4
  51. data/vendor/libgit2/src/pack-objects.c +106 -77
  52. data/vendor/libgit2/src/pack-objects.h +13 -12
  53. data/vendor/libgit2/src/pack.c +4 -3
  54. data/vendor/libgit2/src/pack.h +2 -0
  55. data/vendor/libgit2/src/patch.c +207 -0
  56. data/vendor/libgit2/src/patch.h +66 -0
  57. data/vendor/libgit2/src/{diff_patch.c → patch_generate.c} +171 -359
  58. data/vendor/libgit2/src/patch_generate.h +66 -0
  59. data/vendor/libgit2/src/patch_parse.c +1121 -0
  60. data/vendor/libgit2/src/patch_parse.h +54 -0
  61. data/vendor/libgit2/src/path.c +19 -0
  62. data/vendor/libgit2/src/path.h +6 -0
  63. data/vendor/libgit2/src/pool.h +5 -0
  64. data/vendor/libgit2/src/remote.c +15 -80
  65. data/vendor/libgit2/src/repository.c +227 -39
  66. data/vendor/libgit2/src/settings.c +11 -5
  67. data/vendor/libgit2/src/stash.c +1 -0
  68. data/vendor/libgit2/src/status.c +1 -0
  69. data/vendor/libgit2/src/stransport_stream.c +14 -9
  70. data/vendor/libgit2/src/submodule.c +16 -4
  71. data/vendor/libgit2/src/sysdir.c +41 -47
  72. data/vendor/libgit2/src/sysdir.h +0 -5
  73. data/vendor/libgit2/src/thread-utils.h +5 -51
  74. data/vendor/libgit2/src/transport.c +3 -5
  75. data/vendor/libgit2/src/transports/http.c +2 -3
  76. data/vendor/libgit2/src/transports/smart_pkt.c +1 -0
  77. data/vendor/libgit2/src/transports/smart_protocol.c +11 -0
  78. data/vendor/libgit2/src/transports/winhttp.c +16 -2
  79. data/vendor/libgit2/src/unix/pthread.h +54 -0
  80. data/vendor/libgit2/src/util.c +23 -5
  81. data/vendor/libgit2/src/util.h +10 -0
  82. data/vendor/libgit2/src/varint.c +44 -0
  83. data/vendor/libgit2/src/varint.h +15 -0
  84. data/vendor/libgit2/src/vector.c +42 -0
  85. data/vendor/libgit2/src/vector.h +3 -0
  86. data/vendor/libgit2/src/win32/precompiled.h +1 -1
  87. data/vendor/libgit2/src/win32/{pthread.c → thread.c} +50 -80
  88. data/vendor/libgit2/src/win32/thread.h +62 -0
  89. data/vendor/libgit2/src/zstream.c +36 -7
  90. data/vendor/libgit2/src/zstream.h +8 -1
  91. metadata +20 -9
  92. data/vendor/libgit2/src/delta-apply.c +0 -166
  93. data/vendor/libgit2/src/delta-apply.h +0 -62
  94. data/vendor/libgit2/src/diff_patch.h +0 -83
  95. data/vendor/libgit2/src/win32/pthread.h +0 -92
@@ -1,83 +0,0 @@
1
- /*
2
- * Copyright (C) the libgit2 contributors. All rights reserved.
3
- *
4
- * This file is part of libgit2, distributed under the GNU GPL v2 with
5
- * a Linking Exception. For full terms see the included COPYING file.
6
- */
7
- #ifndef INCLUDE_diff_patch_h__
8
- #define INCLUDE_diff_patch_h__
9
-
10
- #include "common.h"
11
- #include "diff.h"
12
- #include "diff_file.h"
13
- #include "array.h"
14
- #include "git2/patch.h"
15
-
16
- /* cached information about a hunk in a diff */
17
- typedef struct diff_patch_hunk {
18
- git_diff_hunk hunk;
19
- size_t line_start;
20
- size_t line_count;
21
- } diff_patch_hunk;
22
-
23
- enum {
24
- GIT_DIFF_PATCH_ALLOCATED = (1 << 0),
25
- GIT_DIFF_PATCH_INITIALIZED = (1 << 1),
26
- GIT_DIFF_PATCH_LOADED = (1 << 2),
27
- /* the two sides are different */
28
- GIT_DIFF_PATCH_DIFFABLE = (1 << 3),
29
- /* the difference between the two sides has been computed */
30
- GIT_DIFF_PATCH_DIFFED = (1 << 4),
31
- GIT_DIFF_PATCH_FLATTENED = (1 << 5),
32
- };
33
-
34
- struct git_patch {
35
- git_refcount rc;
36
- git_diff *diff; /* for refcount purposes, maybe NULL for blob diffs */
37
- git_diff_options diff_opts;
38
- git_diff_delta *delta;
39
- size_t delta_index;
40
- git_diff_file_content ofile;
41
- git_diff_file_content nfile;
42
- uint32_t flags;
43
- git_diff_binary binary;
44
- git_array_t(diff_patch_hunk) hunks;
45
- git_array_t(git_diff_line) lines;
46
- size_t content_size, context_size, header_size;
47
- git_pool flattened;
48
- };
49
-
50
- extern git_diff *git_patch__diff(git_patch *);
51
-
52
- extern git_diff_driver *git_patch__driver(git_patch *);
53
-
54
- extern void git_patch__old_data(char **, size_t *, git_patch *);
55
- extern void git_patch__new_data(char **, size_t *, git_patch *);
56
-
57
- extern int git_patch__invoke_callbacks(
58
- git_patch *patch,
59
- git_diff_file_cb file_cb,
60
- git_diff_binary_cb binary_cb,
61
- git_diff_hunk_cb hunk_cb,
62
- git_diff_line_cb line_cb,
63
- void *payload);
64
-
65
- typedef struct git_diff_output git_diff_output;
66
- struct git_diff_output {
67
- /* these callbacks are issued with the diff data */
68
- git_diff_file_cb file_cb;
69
- git_diff_binary_cb binary_cb;
70
- git_diff_hunk_cb hunk_cb;
71
- git_diff_line_cb data_cb;
72
- void *payload;
73
-
74
- /* this records the actual error in cases where it may be obscured */
75
- int error;
76
-
77
- /* this callback is used to do the diff and drive the other callbacks.
78
- * see diff_xdiff.h for how to use this in practice for now.
79
- */
80
- int (*diff_cb)(git_diff_output *output, git_patch *patch);
81
- };
82
-
83
- #endif
@@ -1,92 +0,0 @@
1
- /*
2
- * Copyright (C) the libgit2 contributors. All rights reserved.
3
- *
4
- * This file is part of libgit2, distributed under the GNU GPL v2 with
5
- * a Linking Exception. For full terms see the included COPYING file.
6
- */
7
-
8
- #ifndef GIT_PTHREAD_H
9
- #define GIT_PTHREAD_H
10
-
11
- #include "../common.h"
12
-
13
- #if defined (_MSC_VER)
14
- # define GIT_RESTRICT __restrict
15
- #else
16
- # define GIT_RESTRICT __restrict__
17
- #endif
18
-
19
- typedef struct {
20
- HANDLE thread;
21
- void *(*proc)(void *);
22
- void *param;
23
- void *result;
24
- } git_win32_thread;
25
-
26
- typedef int pthread_mutexattr_t;
27
- typedef int pthread_condattr_t;
28
- typedef int pthread_attr_t;
29
- typedef int pthread_rwlockattr_t;
30
-
31
- typedef CRITICAL_SECTION pthread_mutex_t;
32
- typedef HANDLE pthread_cond_t;
33
-
34
- typedef struct { void *Ptr; } GIT_SRWLOCK;
35
-
36
- typedef struct {
37
- union {
38
- GIT_SRWLOCK srwl;
39
- CRITICAL_SECTION csec;
40
- } native;
41
- } pthread_rwlock_t;
42
-
43
- #define PTHREAD_MUTEX_INITIALIZER {(void*)-1}
44
-
45
- int git_win32__thread_create(
46
- git_win32_thread *GIT_RESTRICT,
47
- const pthread_attr_t *GIT_RESTRICT,
48
- void *(*) (void *),
49
- void *GIT_RESTRICT);
50
-
51
- int git_win32__thread_join(
52
- git_win32_thread *,
53
- void **);
54
-
55
- #ifdef GIT_THREADS
56
-
57
- typedef git_win32_thread git_thread;
58
-
59
- #define git_thread_create(git_thread_ptr, attr, start_routine, arg) \
60
- git_win32__thread_create(git_thread_ptr, attr, start_routine, arg)
61
- #define git_thread_join(git_thread_ptr, status) \
62
- git_win32__thread_join(git_thread_ptr, status)
63
-
64
- #endif
65
-
66
- int pthread_mutex_init(
67
- pthread_mutex_t *GIT_RESTRICT mutex,
68
- const pthread_mutexattr_t *GIT_RESTRICT mutexattr);
69
- int pthread_mutex_destroy(pthread_mutex_t *);
70
- int pthread_mutex_lock(pthread_mutex_t *);
71
- int pthread_mutex_unlock(pthread_mutex_t *);
72
-
73
- int pthread_cond_init(pthread_cond_t *, const pthread_condattr_t *);
74
- int pthread_cond_destroy(pthread_cond_t *);
75
- int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *);
76
- int pthread_cond_signal(pthread_cond_t *);
77
- /* pthread_cond_broadcast is not supported on Win32 yet. */
78
-
79
- int pthread_num_processors_np(void);
80
-
81
- int pthread_rwlock_init(
82
- pthread_rwlock_t *GIT_RESTRICT lock,
83
- const pthread_rwlockattr_t *GIT_RESTRICT attr);
84
- int pthread_rwlock_rdlock(pthread_rwlock_t *);
85
- int pthread_rwlock_rdunlock(pthread_rwlock_t *);
86
- int pthread_rwlock_wrlock(pthread_rwlock_t *);
87
- int pthread_rwlock_wrunlock(pthread_rwlock_t *);
88
- int pthread_rwlock_destroy(pthread_rwlock_t *);
89
-
90
- extern int win32_pthread_initialize(void);
91
-
92
- #endif