-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
skip validation when rebase, merge or cherry-pick (#13)
* 馃攢 skip validation when rebase, merge or cherry-pick * 馃攬 remove console.log
- Loading branch information
Showing
6 changed files
with
103 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { promises as fs } from 'fs'; | ||
import { join } from 'path'; | ||
|
||
export const isCherryPickInProgress = async (): Promise<boolean> => { | ||
try { | ||
try { | ||
await fs.access(join('.git', 'CHERRY_PICK_HEAD')); | ||
|
||
return true; | ||
} catch (error) { | ||
return false; | ||
} | ||
} catch (error) { | ||
console.error('isCherryPickInProgress error', error); | ||
|
||
return false; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { promises as fs } from 'fs'; | ||
import { join } from 'path'; | ||
|
||
export const isMergeInProgress = async (): Promise<boolean> => { | ||
try { | ||
try { | ||
await fs.access(join('.git', 'MERGE_HEAD')); | ||
|
||
return true; | ||
} catch (error) { | ||
return false; | ||
} | ||
} catch (error) { | ||
console.error('isMergeInProgress error', error); | ||
|
||
return false; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { promises as fs } from 'fs'; | ||
import { join } from 'path'; | ||
|
||
export const isRebaseInProgress = async (): Promise<boolean> => { | ||
try { | ||
const rebaseMergeExists = await fs | ||
.access(join('.git', 'rebase-merge')) | ||
.then( | ||
() => { | ||
console.log('rebase in progress...'); | ||
|
||
return true; | ||
}, | ||
() => false, | ||
); | ||
|
||
const rebaseApplyExists = await fs | ||
.access(join('.git', 'rebase-apply')) | ||
.then( | ||
() => { | ||
return true; | ||
}, | ||
() => false, | ||
); | ||
|
||
return rebaseMergeExists || rebaseApplyExists; | ||
} catch (error) { | ||
console.error('isRebaseInProgress error', error); | ||
|
||
return false; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters