mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-06-23 09:19:26 -04:00
refactor(repository)!: remove excessive aliases (#40)
BREAKING CHANGE: instead of removed aliases, API methods from relevant classes should be called (e.g. Commit.create, Reference.lookup, etc.)
This commit is contained in:
parent
432abffa89
commit
e7c18c35e2
13 changed files with 144 additions and 1063 deletions
|
@ -71,9 +71,7 @@ void main() {
|
|||
});
|
||||
|
||||
test('checkouts reference', () {
|
||||
final masterHead = repo.lookupCommit(
|
||||
repo['821ed6e80627b8769d170a293862f9fc60825226'],
|
||||
);
|
||||
final masterHead = Commit.lookup(repo: repo, oid: repo['821ed6e']);
|
||||
final masterTree = masterHead.tree;
|
||||
expect(
|
||||
masterTree.entries.any((e) => e.name == 'another_feature_file'),
|
||||
|
@ -81,9 +79,7 @@ void main() {
|
|||
);
|
||||
|
||||
repo.checkout(target: 'refs/heads/feature');
|
||||
final featureHead = repo.lookupCommit(
|
||||
repo['5aecfa0fb97eadaac050ccb99f03c3fb65460ad4'],
|
||||
);
|
||||
final featureHead = Commit.lookup(repo: repo, oid: repo['5aecfa0']);
|
||||
final featureTree = featureHead.tree;
|
||||
final repoHead = repo.head;
|
||||
expect(repoHead.target, featureHead.oid);
|
||||
|
@ -116,9 +112,7 @@ void main() {
|
|||
final index = repo.index;
|
||||
expect(index.find('another_feature_file'), equals(false));
|
||||
|
||||
final featureHead = repo.lookupCommit(
|
||||
repo['5aecfa0fb97eadaac050ccb99f03c3fb65460ad4'],
|
||||
);
|
||||
final featureHead = Commit.lookup(repo: repo, oid: repo['5aecfa0']);
|
||||
repo.checkout(target: featureHead.oid);
|
||||
|
||||
final repoHead = repo.head;
|
||||
|
@ -132,9 +126,7 @@ void main() {
|
|||
});
|
||||
|
||||
test('checkouts commit with provided path', () {
|
||||
final featureHead = repo.lookupCommit(
|
||||
repo['5aecfa0fb97eadaac050ccb99f03c3fb65460ad4'],
|
||||
);
|
||||
final featureHead = Commit.lookup(repo: repo, oid: repo['5aecfa0']);
|
||||
repo.checkout(target: featureHead.oid, paths: ['another_feature_file']);
|
||||
|
||||
final repoHead = repo.head;
|
||||
|
@ -167,7 +159,10 @@ void main() {
|
|||
});
|
||||
|
||||
test('checkouts file with provided path', () {
|
||||
final featureTip = repo.lookupReference('refs/heads/feature').target;
|
||||
final featureTip = Reference.lookup(
|
||||
repo: repo,
|
||||
name: 'refs/heads/feature',
|
||||
).target;
|
||||
|
||||
expect(repo.status, isEmpty);
|
||||
repo.checkout(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue