aboutsummaryrefslogtreecommitdiff
path: root/packages/server/src/git/reference.ts
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2021-06-24 22:50:38 +0200
committerHampusM <hampus@hampusmat.com>2021-06-24 22:50:38 +0200
commita13786d6cc185822f5940582efde2349ef729145 (patch)
tree7d4f49b50fc30ced65c5661b22b027456b79948e /packages/server/src/git/reference.ts
parent01e5d215dbc152e34ecd005111171457f87c235d (diff)
Refactored the backend yet again
Diffstat (limited to 'packages/server/src/git/reference.ts')
-rw-r--r--packages/server/src/git/reference.ts18
1 files changed, 18 insertions, 0 deletions
diff --git a/packages/server/src/git/reference.ts b/packages/server/src/git/reference.ts
new file mode 100644
index 0000000..910fa7d
--- /dev/null
+++ b/packages/server/src/git/reference.ts
@@ -0,0 +1,18 @@
+import { Reference as NodeGitReference } from "nodegit";
+import { Repository } from "./repository";
+
+export abstract class Reference {
+ protected _ng_reference: NodeGitReference;
+ protected _owner: Repository;
+
+ id: string;
+ name: string;
+
+ constructor(owner: Repository, reference: NodeGitReference) {
+ this._ng_reference = reference;
+ this._owner = owner;
+
+ this.id = reference.target().tostrS();
+ this.name = reference.shorthand();
+ }
+} \ No newline at end of file