claude-attribution 1.1.2 → 1.1.3

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": "claude-attribution",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "AI code attribution tracking for Claude Code sessions — checkpoint-based line diff approach",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli.ts CHANGED
@@ -77,6 +77,7 @@ switch (cmd) {
77
77
  process.exit(0);
78
78
  break;
79
79
  }
80
+ case undefined:
80
81
  case "help":
81
82
  case "--help":
82
83
  case "-h":
@@ -97,7 +98,7 @@ Commands:
97
98
  break;
98
99
  default:
99
100
  console.error(
100
- `Unknown command: ${cmd ?? "(none)"}. Run "claude-attribution help" for usage.`,
101
+ `Unknown command: ${cmd}. Run "claude-attribution help" for usage.`,
101
102
  );
102
103
  process.exit(1);
103
104
  }
@@ -133,8 +133,8 @@ async function main() {
133
133
  body = template.trimEnd() + "\n\n" + metricsBlock;
134
134
  }
135
135
 
136
- // Push branch to remote. If the branch already has a remote tracking ref,
137
- // push any new commits (no-op if up-to-date). Otherwise set tracking with -u.
136
+ // Push the current branch to remote. Always push only the branch ref (not
137
+ // notes or other configured refspecs). Set tracking with -u if not yet set.
138
138
  try {
139
139
  const hasUpstream = await execFileAsync(
140
140
  "git",
@@ -144,11 +144,12 @@ async function main() {
144
144
  () => true,
145
145
  () => false,
146
146
  );
147
+ const branch = await getCurrentBranch(repoRoot);
147
148
  if (hasUpstream) {
148
- // Branch already pushed — push any new commits, ignore "already up-to-date"
149
- await execFileAsync("git", ["push"], { cwd: repoRoot }).catch(() => {});
149
+ // Branch already has upstream — push new commits only (no-op if up-to-date)
150
+ await execFileAsync("git", ["push", "origin", branch], { cwd: repoRoot });
150
151
  } else {
151
- await execFileAsync("git", ["push", "-u", "origin", "HEAD"], {
152
+ await execFileAsync("git", ["push", "-u", "origin", branch], {
152
153
  cwd: repoRoot,
153
154
  });
154
155
  }