Skip to content
This repository has been archived by the owner on Feb 25, 2023. It is now read-only.

Commit

Permalink
refactor(repository)!: remove excessive aliases (#40)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: instead of removed aliases, API methods from relevant
classes should be called (e.g. Commit.create, Reference.lookup, etc.)
  • Loading branch information
SkinnyMind committed Jan 25, 2022
1 parent 432abff commit e7c18c3
Show file tree
Hide file tree
Showing 13 changed files with 132 additions and 1,051 deletions.
9 changes: 5 additions & 4 deletions example/reference_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,25 @@ void main() {
print('Repository references: ${repo.references}');

// Get reference by name.
final ref = repo.lookupReference('refs/heads/master');
final ref = Reference.lookup(repo: repo, name: 'refs/heads/master');

print('Reference SHA hex: ${ref.target.sha}');
print('Is reference a local branch: ${ref.isBranch}');
print('Reference full name: ${ref.name}');
print('Reference shorthand name: ${ref.shorthand}');

// Create new reference (direct or symbolic).
final newRef = repo.createReference(
final newRef = Reference.create(
repo: repo,
name: 'refs/tags/v1',
target: 'refs/heads/master',
);

// Rename reference.
repo.renameReference(oldName: 'v1', newName: 'refs/tags/v1.1');
Reference.rename(repo: repo, oldName: 'v1', newName: 'refs/tags/v1.1');

// Delete reference.
repo.deleteReference('v1.1');
Reference.delete(repo: repo, name: 'v1.1');

// free() should be called on object to free memory when done.
ref.free();
Expand Down
Loading

0 comments on commit e7c18c3

Please sign in to comment.