git-watchtower 2.1.0 → 2.1.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-watchtower",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "Terminal-based Git branch monitor with activity sparklines and optional dev server with live reload",
5
5
  "main": "bin/git-watchtower.js",
6
6
  "bin": {
package/src/git/branch.js CHANGED
@@ -103,7 +103,7 @@ async function getAllBranches(options = {}) {
103
103
  // Use \x1f (Unit Separator) as delimiter since | can appear in commit subjects
104
104
  const delimiter = '\x1f';
105
105
  const localResult = await execGit(
106
- ['for-each-ref', '--sort=-committerdate', `--format=%(refname:short)${delimiter}%(committerdate:iso8601)${delimiter}%(objectname:short)${delimiter}%(subject)`, 'refs/heads/'],
106
+ ['for-each-ref', '--sort=-committerdate', `--format=%(refname:short)${delimiter}%(committerdate:iso8601-strict)${delimiter}%(objectname:short)${delimiter}%(subject)`, 'refs/heads/'],
107
107
  { cwd }
108
108
  );
109
109
 
@@ -128,7 +128,7 @@ async function getAllBranches(options = {}) {
128
128
 
129
129
  // Get remote branches
130
130
  const remoteResult = await execGit(
131
- ['for-each-ref', '--sort=-committerdate', `--format=%(refname:short)${delimiter}%(committerdate:iso8601)${delimiter}%(objectname:short)${delimiter}%(subject)`, `refs/remotes/${remoteName}/`],
131
+ ['for-each-ref', '--sort=-committerdate', `--format=%(refname:short)${delimiter}%(committerdate:iso8601-strict)${delimiter}%(objectname:short)${delimiter}%(subject)`, `refs/remotes/${remoteName}/`],
132
132
  { cwd }
133
133
  );
134
134
 
@@ -261,8 +261,12 @@ async function getCommitsByDay(branchName, days = 7, cwd) {
261
261
  const counts = new Array(days).fill(0);
262
262
 
263
263
  try {
264
+ // %cI is strict ISO 8601 (YYYY-MM-DDTHH:MM:SS±HH:MM). %ci uses a
265
+ // space separator and a compact ±HHMM offset — V8 parses it today,
266
+ // but the spec doesn't require engines to accept non-strict forms,
267
+ // so rely on the strict variant for Date(string) parsing.
264
268
  const { stdout } = await execGit(
265
- ['log', branchName, '--format=%ci', `--since=${days} days ago`],
269
+ ['log', branchName, '--format=%cI', `--since=${days} days ago`],
266
270
  { cwd, timeout: 10000 }
267
271
  );
268
272