mirror of
https://forgejo.stefka.eu/jiriks74/create-pull-request.git
synced 2025-01-18 16:01:06 +01:00
proper shallow check
This commit is contained in:
parent
e0776265c5
commit
619bfb4fa4
1 changed files with 6 additions and 5 deletions
|
@ -114,11 +114,7 @@ export class GitCommandManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
args.push('--progress', '--no-recurse-submodules')
|
args.push('--progress', '--no-recurse-submodules')
|
||||||
if (
|
if (await this.isShallow()) {
|
||||||
utils.fileExistsSync(
|
|
||||||
realpathSync(path.join(this.workingDirectory, '.git', 'shallow'))
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
args.push('--unshallow')
|
args.push('--unshallow')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,6 +160,11 @@ export class GitCommandManager {
|
||||||
return this.workingDirectory
|
return this.workingDirectory
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async isShallow(): Promise<boolean> {
|
||||||
|
const result = await this.revParse('', ['--is-shallow-repository'])
|
||||||
|
return result === 'true'
|
||||||
|
}
|
||||||
|
|
||||||
async hasDiff(options?: string[]): Promise<boolean> {
|
async hasDiff(options?: string[]): Promise<boolean> {
|
||||||
const args = ['diff', '--quiet']
|
const args = ['diff', '--quiet']
|
||||||
if (options) {
|
if (options) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue