Skip to content

Commit 7dad60b

Browse files
committed
Document parsePackedRefs
1 parent 1570955 commit 7dad60b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/git/url_prefix.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@ var path = require('path');
33
var gitUrlParse = require('git-url-parse');
44
var getRemoteOrigin = require('remote-origin-url');
55

6+
/**
7+
* Sometimes git will [pack refs](https://git-scm.com/docs/git-pack-refs)
8+
* in order to save space on disk and
9+
* duck under limits of numbers of files in folders. CircleCI in particular
10+
* does this by default. This method parses that `packed-refs` file
11+
*
12+
* @private
13+
* @param {string} packedRefs string contents of the packed refs file
14+
* @param {string} branchName the branch name to resolve to
15+
* @returns {string} sha hash referring to current tree
16+
*/
617
function parsePackedRefs(packedRefs, branchName) {
718
return packedRefs.split(/\n/)
819
.filter(function (line) {

0 commit comments

Comments
 (0)