-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi-repo: ensure external source gets updated if repo url changes #241
Conversation
09230f0
to
bec01c0
Compare
garden-cli/src/vcs/git.ts
Outdated
} | ||
}, | ||
} | ||
|
||
function getUrlHash(url: string) { | ||
return (parse(url).hash || "").split("#")[1] | ||
function getGitUrlParts(url: string): { repositoryUrl: string, hash: string } { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't really matter here, but this type annotation can also just be inferred and not explicitly stated.
garden-cli/src/vcs/git.ts
Outdated
if (!isCloned) { | ||
const entry = logEntry.info({ section: name, msg: `Fetching from ${url}`, entryStyle: EntryStyle.activity }) | ||
const { repositoryUrl, hash } = getGitUrlParts(url) | ||
await git("clone", "--depth", "1", "--branch", hash, repositoryUrl, absPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the hash is an empty string here?
garden-cli/src/vcs/git.ts
Outdated
await git("remote", "update") | ||
|
||
const remoteHash = (await git("ls-remote", repositoryUrl, hash)).split("\t")[0] | ||
const localHash = (await git("show-ref", "--hash", hash)).split("\n")[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question here. Do we need to have a default hash/branch? Or would it make more sense to conditionally add these params?
bec01c0
to
323b6e9
Compare
I've resolved the issues above. |
No description provided.