git-watchtower 1.9.3 → 1.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/git-watchtower.js +8 -4
- package/package.json +1 -1
package/bin/git-watchtower.js
CHANGED
|
@@ -1424,13 +1424,16 @@ async function getAllBranches() {
|
|
|
1424
1424
|
const seenBranches = new Set();
|
|
1425
1425
|
|
|
1426
1426
|
// Get local branches
|
|
1427
|
+
// Use \x1f (Unit Separator) as delimiter since | can appear in commit subjects
|
|
1428
|
+
const delimiter = '\x1f';
|
|
1427
1429
|
const { stdout: localOutput } = await execGit(
|
|
1428
|
-
['for-each-ref', '--sort=-committerdate',
|
|
1430
|
+
['for-each-ref', '--sort=-committerdate', `--format=%(refname:short)${delimiter}%(committerdate:iso8601)${delimiter}%(objectname:short)${delimiter}%(subject)`, 'refs/heads/'],
|
|
1429
1431
|
{ cwd: PROJECT_ROOT }
|
|
1430
1432
|
);
|
|
1431
1433
|
|
|
1432
1434
|
for (const line of localOutput.split('\n').filter(Boolean)) {
|
|
1433
|
-
const [name, dateStr, commit,
|
|
1435
|
+
const [name, dateStr, commit, ...subjectParts] = line.split(delimiter);
|
|
1436
|
+
const subject = subjectParts.join(delimiter);
|
|
1434
1437
|
if (!seenBranches.has(name) && isValidBranchName(name)) {
|
|
1435
1438
|
seenBranches.add(name);
|
|
1436
1439
|
branchList.push({
|
|
@@ -1447,14 +1450,15 @@ async function getAllBranches() {
|
|
|
1447
1450
|
|
|
1448
1451
|
// Get remote branches (using configured remote name)
|
|
1449
1452
|
const remoteResult = await execGitSilent(
|
|
1450
|
-
['for-each-ref', '--sort=-committerdate',
|
|
1453
|
+
['for-each-ref', '--sort=-committerdate', `--format=%(refname:short)${delimiter}%(committerdate:iso8601)${delimiter}%(objectname:short)${delimiter}%(subject)`, `refs/remotes/${REMOTE_NAME}/`],
|
|
1451
1454
|
{ cwd: PROJECT_ROOT }
|
|
1452
1455
|
);
|
|
1453
1456
|
const remoteOutput = remoteResult ? remoteResult.stdout : '';
|
|
1454
1457
|
|
|
1455
1458
|
const remotePrefix = `${REMOTE_NAME}/`;
|
|
1456
1459
|
for (const line of remoteOutput.split('\n').filter(Boolean)) {
|
|
1457
|
-
const [fullName, dateStr, commit,
|
|
1460
|
+
const [fullName, dateStr, commit, ...subjectParts] = line.split(delimiter);
|
|
1461
|
+
const subject = subjectParts.join(delimiter);
|
|
1458
1462
|
const name = fullName.replace(remotePrefix, '');
|
|
1459
1463
|
if (name === 'HEAD') continue;
|
|
1460
1464
|
if (!isValidBranchName(name)) continue;
|
package/package.json
CHANGED