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 +1 -1
- package/src/cli.ts +2 -1
- package/src/commands/pr.ts +6 -5
package/package.json
CHANGED
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
|
|
101
|
+
`Unknown command: ${cmd}. Run "claude-attribution help" for usage.`,
|
|
101
102
|
);
|
|
102
103
|
process.exit(1);
|
|
103
104
|
}
|
package/src/commands/pr.ts
CHANGED
|
@@ -133,8 +133,8 @@ async function main() {
|
|
|
133
133
|
body = template.trimEnd() + "\n\n" + metricsBlock;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
// Push branch to remote.
|
|
137
|
-
//
|
|
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
|
|
149
|
-
await execFileAsync("git", ["push"], { cwd: repoRoot })
|
|
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",
|
|
152
|
+
await execFileAsync("git", ["push", "-u", "origin", branch], {
|
|
152
153
|
cwd: repoRoot,
|
|
153
154
|
});
|
|
154
155
|
}
|