Skip to content

fix error when both ref and depth specified#226

Open
AliAllomani wants to merge 3 commits intohashicorp:mainfrom
AliAllomani:fix_git_ref_depth
Open

fix error when both ref and depth specified#226
AliAllomani wants to merge 3 commits intohashicorp:mainfrom
AliAllomani:fix_git_ref_depth

Conversation

@AliAllomani
Copy link

Related to Issue #225

  • g.clone doesn't define which branch to clone, so when depth is specified it's only clone master branch
  • after that it tries to checkout to the branch with g.checkout(dst, ref)
  • since the defined branch hasn't been cloned, it fail with the error message "error: pathspec 'XXX' did not match any file(s) known to git"

@hashicorp-cla
Copy link

hashicorp-cla commented Nov 28, 2019

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes


Ali Allomani seems not to be a GitHub user.
You need a GitHub account to be able to sign the CLA. If you already have a GitHub account, please add the email address used for this commit to your account.

Have you signed the CLA already but the status is still pending? Recheck it.

@sebglon
Copy link

sebglon commented Jun 26, 2020

Hi,
How we can help to fix/merge this PR?
We have the same bug with a very big repository and we want to use the depth.

Regards

@sebglon
Copy link

sebglon commented Jun 26, 2020

We can probably use git clone --no-checkout --depth 1 to import the git index
And after that use the git checkout already defined on the update func.

It seems better

@mdeggies mdeggies changed the base branch from master to main October 23, 2020 00:54
@SergeyMuha
Copy link

Waiting for the fix

@zachwhaley
Copy link
Contributor

zachwhaley commented Nov 13, 2020

Duplicate #266

Feel free to use code from mine if you want.

@william-salt-cko
Copy link

@azr sorry to @ you. I think you are one of the main contributors/maintainers of the package, could you perhaps chime in on this, or the associated PRs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants