Allow for bare clone

Signed-off-by: Andre Wanlin <awanlin@rapidrtc.com>
This commit is contained in:
Andre Wanlin
2021-12-31 18:49:53 -06:00
parent fbdb1ec331
commit 21ae56168e
3 changed files with 18 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/backend-common': patch
---
Updated Git to allow for bare clone
+7 -1
View File
@@ -235,7 +235,13 @@ export class Git {
url: string;
}): Promise<void>;
// (undocumented)
clone(options: { url: string; dir: string; ref?: string }): Promise<void>;
clone(options: {
url: string;
dir: string;
ref?: string;
depth?: number;
noCheckout?: boolean;
}): Promise<void>;
// (undocumented)
commit(options: {
dir: string;
+6 -2
View File
@@ -76,12 +76,15 @@ export class Git {
return git.commit({ fs, dir, message, author, committer });
}
// https://isomorphic-git.org/docs/en/clone
async clone(options: {
url: string;
dir: string;
ref?: string;
depth?: number;
noCheckout?: boolean;
}): Promise<void> {
const { url, dir, ref } = options;
const { url, dir, ref, depth, noCheckout } = options;
this.config.logger?.info(`Cloning repo {dir=${dir},url=${url}}`);
return git.clone({
fs,
@@ -90,7 +93,8 @@ export class Git {
dir,
ref,
singleBranch: true,
depth: 1,
depth: depth ?? 1,
noCheckout: noCheckout ?? false,
onProgress: this.onProgressHandler(),
headers: {
'user-agent': 'git/@isomorphic-git',