rugged 0.24.0b7 → 0.24.0b8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/rugged/rugged_repo.c +58 -0
- data/lib/rugged/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a84e4447d122b19232a1d4a1134a15898d088730
|
4
|
+
data.tar.gz: 027946b6e6c8513aa9436ee9e24b886c924437ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95611e993578c036601909af7215eebe76eeb42a4c2a919ac1a59c2a580cf5743198843eb946b3e210d3bacb7faf2403ab3acd6d349cbab8f6cc56b5131b2d2e
|
7
|
+
data.tar.gz: 4b70d32119d8544c4910dd6b735aa2ce704ba01da9effcbbfbc9ea6f34a97123292d8598394acf05c9f73d2b8066a4a2924c9c6c190127c021fef3007b6d4f57
|
data/ext/rugged/rugged_repo.c
CHANGED
@@ -829,6 +829,62 @@ static VALUE rb_git_repo_merge_analysis(int argc, VALUE *argv, VALUE self)
|
|
829
829
|
return result;
|
830
830
|
}
|
831
831
|
|
832
|
+
/*
|
833
|
+
* call-seq:
|
834
|
+
* repo.revert_commit(revert_commit, our_commit, options = {}) -> index
|
835
|
+
*
|
836
|
+
* Reverts the given commit against the given "our" commit, producing an
|
837
|
+
* index that reflects the result of the revert.
|
838
|
+
*/
|
839
|
+
static VALUE rb_git_repo_revert_commit(int argc, VALUE *argv, VALUE self)
|
840
|
+
{
|
841
|
+
VALUE rb_revert_commit, rb_our_commit, rb_options;
|
842
|
+
git_commit *revert_commit, *our_commit;
|
843
|
+
git_index *index;
|
844
|
+
git_repository *repo;
|
845
|
+
git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
|
846
|
+
unsigned int mainline = 0;
|
847
|
+
int error;
|
848
|
+
|
849
|
+
rb_scan_args(argc, argv, "20:", &rb_revert_commit, &rb_our_commit, &rb_options);
|
850
|
+
|
851
|
+
if (TYPE(rb_revert_commit) == T_STRING)
|
852
|
+
rb_revert_commit = rugged_object_rev_parse(self, rb_revert_commit, 1);
|
853
|
+
|
854
|
+
if (TYPE(rb_our_commit) == T_STRING)
|
855
|
+
rb_our_commit = rugged_object_rev_parse(self, rb_our_commit, 1);
|
856
|
+
|
857
|
+
if (!rb_obj_is_kind_of(rb_revert_commit, rb_cRuggedCommit) ||
|
858
|
+
!rb_obj_is_kind_of(rb_our_commit, rb_cRuggedCommit)) {
|
859
|
+
rb_raise(rb_eArgError, "Expected a Rugged::Commit.");
|
860
|
+
}
|
861
|
+
|
862
|
+
if (!NIL_P(rb_options)) {
|
863
|
+
VALUE rb_mainline;
|
864
|
+
|
865
|
+
Check_Type(rb_options, T_HASH);
|
866
|
+
rugged_parse_merge_options(&opts, rb_options);
|
867
|
+
|
868
|
+
rb_mainline = rb_hash_aref(rb_options, CSTR2SYM("mainline"));
|
869
|
+
if (!NIL_P(rb_mainline)) {
|
870
|
+
Check_Type(rb_mainline, T_FIXNUM);
|
871
|
+
mainline = FIX2UINT(rb_mainline);
|
872
|
+
}
|
873
|
+
}
|
874
|
+
|
875
|
+
Data_Get_Struct(self, git_repository, repo);
|
876
|
+
Data_Get_Struct(rb_revert_commit, git_commit, revert_commit);
|
877
|
+
Data_Get_Struct(rb_our_commit, git_commit, our_commit);
|
878
|
+
|
879
|
+
error = git_revert_commit(&index, repo, revert_commit, our_commit, mainline, &opts);
|
880
|
+
if (error == GIT_EMERGECONFLICT)
|
881
|
+
return Qnil;
|
882
|
+
|
883
|
+
rugged_exception_check(error);
|
884
|
+
|
885
|
+
return rugged_index_new(rb_cRuggedIndex, self, index);
|
886
|
+
}
|
887
|
+
|
832
888
|
/*
|
833
889
|
* call-seq:
|
834
890
|
* repo.merge_commits(our_commit, their_commit, options = {}) -> index
|
@@ -2528,6 +2584,8 @@ void Init_rugged_repo(void)
|
|
2528
2584
|
rb_define_method(rb_cRuggedRepo, "merge_analysis", rb_git_repo_merge_analysis, -1);
|
2529
2585
|
rb_define_method(rb_cRuggedRepo, "merge_commits", rb_git_repo_merge_commits, -1);
|
2530
2586
|
|
2587
|
+
rb_define_method(rb_cRuggedRepo, "revert_commit", rb_git_repo_revert_commit, -1);
|
2588
|
+
|
2531
2589
|
rb_define_method(rb_cRuggedRepo, "path_ignored?", rb_git_repo_is_path_ignored, 1);
|
2532
2590
|
|
2533
2591
|
rb_define_method(rb_cRuggedRepo, "reset", rb_git_repo_reset, 2);
|
data/lib/rugged/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rugged
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.24.
|
4
|
+
version: 0.24.0b8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Chacon
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-11-
|
12
|
+
date: 2015-11-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake-compiler
|