Skip to content

Commit a6fa150

Browse files
Don't call Operation.update() when the push option is disabled
1 parent 10cd9ed commit a6fa150

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

src/git.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,16 @@ export async function gitTag(operation: Operation): Promise<Operation> {
7171
* Pushes the Git commit and tag, if the `push` option is enabled.
7272
*/
7373
export async function gitPush(operation: Operation): Promise<Operation> {
74-
if (operation.options.push) {
75-
// Push the commit
76-
await ezSpawn.async("git", "push");
77-
78-
if (operation.options.tag) {
79-
// Push the tag
80-
await ezSpawn.async("git", ["push", "--tags"]);
81-
}
74+
if (!operation.options.push) {
75+
return operation;
76+
}
77+
78+
// Push the commit
79+
await ezSpawn.async("git", "push");
80+
81+
if (operation.options.tag) {
82+
// Push the tag
83+
await ezSpawn.async("git", ["push", "--tags"]);
8284
}
8385

8486
return operation.update({ event: ProgressEvent.GitPush });

0 commit comments

Comments
 (0)