Commit 9c22f0f4 authored by Ivanq's avatar Ivanq

Git: Add setRef()

parent 1d5af7ee
......@@ -630,6 +630,9 @@ class Git {
});
});
}
setRef(ref, commit) {
return this.writeFile(ref, this.stringToArray(commit));
}
getBranchCommit(branch) {
// Fallback for branch id
if(this.isSha(branch)) {
......
......@@ -12,7 +12,7 @@ You can either call `readUnknownObject` multiple times or run `readTreeItem(root
### How can I get ref list?
Use `getRefList` which returns an array like `["refs/remotes/origin/master", "refs/heads/master", "refs/remotes/origin/HEAD"]`. Note that the array is not ordered at all.
Use `getRefList` which returns an array like `["refs/remotes/origin/master", "refs/heads/master", "refs/remotes/origin/HEAD"]`. Note that the array is not ordered at all. Then run `getRef("refs/remotes/origin/HEAD")` or `setRef("refs/remotes/origin/HEAD", "0123456789abcdefghij")`.
### How can I use branches?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment