Added Better Action Handling To Merge Command
This commit cleans up some of the action stop handling in the merge command. I was adding this handling to the issue transfer command and saw the same mistakes made here.
This commit is contained in:
parent
1519eeac81
commit
59fe574947
|
@ -184,10 +184,10 @@ export default class Merge extends Command {
|
|||
await exec( filterCommand, { cwd: cloneDir } );
|
||||
} catch {
|
||||
this.error( 'Failed to alter the repository history' );
|
||||
}
|
||||
|
||||
} finally {
|
||||
CliUx.ux.action.stop();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Merges the cloned repository into the current one.
|
||||
|
@ -207,12 +207,16 @@ export default class Merge extends Command {
|
|||
try {
|
||||
await exec( 'git remote add ' + source + ' "' + cloneDir + '"' );
|
||||
} catch {
|
||||
CliUx.ux.action.stop();
|
||||
|
||||
this.error( 'Failed to add clone repository as remote' );
|
||||
}
|
||||
|
||||
try {
|
||||
await exec( 'git fetch ' + source );
|
||||
} catch {
|
||||
CliUx.ux.action.stop();
|
||||
|
||||
this.error( 'Failed to fetch clone repository' );
|
||||
}
|
||||
|
||||
|
@ -224,6 +228,8 @@ export default class Merge extends Command {
|
|||
branchToMerge
|
||||
);
|
||||
} catch {
|
||||
CliUx.ux.action.stop();
|
||||
|
||||
this.error( 'Failed to merge the repositories' );
|
||||
}
|
||||
|
||||
|
@ -232,6 +238,8 @@ export default class Merge extends Command {
|
|||
await exec( 'git remote remove ' + source );
|
||||
await exec( 'rm -rf ' + cloneDir );
|
||||
} catch {
|
||||
CliUx.ux.action.stop();
|
||||
|
||||
this.error( 'Failed to remove clone repository remote' );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue