aboutsummaryrefslogtreecommitdiff
path: root/packages/server/src/git/reference.ts
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2021-07-27 13:18:42 +0200
committerHampusM <hampus@hampusmat.com>2021-07-27 13:18:42 +0200
commitf6a5fe05c887a658c20257d2ef6bf2780f792873 (patch)
tree9ee4b42ed04b3fe7decdac10b20ec96ca764d378 /packages/server/src/git/reference.ts
parent69c58c94bd8cc0d469ae301931d4571aca84851a (diff)
Refactored the backend a bit & added TSDoc/JSDoc comments to the diff class
Diffstat (limited to 'packages/server/src/git/reference.ts')
-rw-r--r--packages/server/src/git/reference.ts15
1 files changed, 0 insertions, 15 deletions
diff --git a/packages/server/src/git/reference.ts b/packages/server/src/git/reference.ts
index 4f4f5a0..4e28e05 100644
--- a/packages/server/src/git/reference.ts
+++ b/packages/server/src/git/reference.ts
@@ -1,16 +1,6 @@
import { Reference as NodeGitReference } from "nodegit";
import { Repository } from "./repository";
-type ReferenceClass<T> = new(owner: Repository, reference: NodeGitReference) => T;
-
-export function isNodeGitReferenceBranch(ref: NodeGitReference): boolean {
- return Boolean(ref.isBranch());
-}
-
-export function isNodeGitReferenceTag(ref: NodeGitReference): boolean {
- return Boolean(ref.isTag());
-}
-
/**
* A representation of a reference
*/
@@ -32,9 +22,4 @@ export abstract class Reference {
this.id = reference.target().tostrS();
this.name = reference.shorthand();
}
-
- public static async all<T>(owner: Repository, Target: ReferenceClass<T>, ref_fn: (ref: NodeGitReference) => boolean): Promise<T[]> {
- const references = await owner.nodegitRepository.getReferences();
- return references.filter(ref_fn).map(ref => new Target(owner, ref));
- }
} \ No newline at end of file