proper shallow check
This commit is contained in:
parent
e0776265c5
commit
619bfb4fa4
@ -114,11 +114,7 @@ export class GitCommandManager {
|
||||
}
|
||||
|
||||
args.push('--progress', '--no-recurse-submodules')
|
||||
if (
|
||||
utils.fileExistsSync(
|
||||
realpathSync(path.join(this.workingDirectory, '.git', 'shallow'))
|
||||
)
|
||||
) {
|
||||
if (await this.isShallow()) {
|
||||
args.push('--unshallow')
|
||||
}
|
||||
|
||||
@ -164,6 +160,11 @@ export class GitCommandManager {
|
||||
return this.workingDirectory
|
||||
}
|
||||
|
||||
async isShallow(): Promise<boolean> {
|
||||
const result = await this.revParse('', ['--is-shallow-repository'])
|
||||
return result === 'true'
|
||||
}
|
||||
|
||||
async hasDiff(options?: string[]): Promise<boolean> {
|
||||
const args = ['diff', '--quiet']
|
||||
if (options) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user