Skip to content

feat: impl reference#18

Merged
seokju-na merged 3 commits intomainfrom
reference
Jan 17, 2025
Merged

feat: impl reference#18
seokju-na merged 3 commits intomainfrom
reference

Conversation

@seokju-na
Copy link
Collaborator

Add reference feature.

import { openRepository } from 'es-git';

const repo = await openRepository('...');
const ref = repo.getReference('HEAD');
console.log(ref.type()); // 'Symbolic'
console.log(ref.symbolicTarget()); // 'refs/heads/main'

const resolvedRef = ref.resolve();
console.log(resolvedRef.type()); // 'Direct'
console.log(resolvedRef.isBranch()); // true
console.log(resolvedRef.target()); // 'a01e9888e46729ef4aa68953ba19b02a7a64eb82'

@seokju-na seokju-na requested a review from raon0211 December 22, 2024 17:00
@seokju-na seokju-na merged commit 152e1a6 into main Jan 17, 2025
18 checks passed
@seokju-na seokju-na deleted the reference branch January 17, 2025 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant