You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 11, 2020. It is now read-only.
When trying to clone a private repo in bitbucket.org, the git directory gets corrupted. I can clone HelloWorld and make commits so the logic in that portion of the code works.
const (
url="reverseflapjack@bitbucket.org:foo/bar.git"//url = "https://github.com/octocat/Hello-World.git"directory="hw"testfile="test.txt"
)
funcdefaultSignature() *object.Signature {
return&object.Signature{
Name: "reverseflapjack",
Email: "flapmyjacks@example.com",
When: time.Now(),
}
}
....
// clone the given repository to the given directoryInfo("git clone %s %s --recursive", url, directory) // loggingr, err:=git.PlainClone(directory, false, &git.CloneOptions{
URL: url,
})
CheckIfError(err)
w, err:=r.Worktree()
CheckIfError(err)
// ... we need a file to commit so let's create a new file inside of the// worktree of the project using the go standard library.Info("echo \"hellow world!\" > example-git-file")
filename:=filepath.Join(directory, "example-git-file")
err=ioutil.WriteFile(filename, []byte("hello world!"), 0644)
CheckIfError(err)
// Adds the new file to the staging area.Info("git add example-git-file")
_, err=w.Add("example-git-file")
CheckIfError(err)
// We can verify the current status of the worktree using the method Status.Info("git status --porcelain")
status, err:=w.Status()
CheckIfError(err)
fmt.Println(status)
// Commits the current staging are to the repository, with the new file// just created. We should provide the object.Signature of Author of the// commit.Info("git commit -m \"example go-git commit\"")
commit, err:=w.Commit("Adds test file", &git.CommitOptions{Author: defaultSignature()})
CheckIfError(err)
// Prints the current HEAD to verify that all worked well.Info("git show -s")
// makes the commitobj, err:=r.CommitObject(commit)
CheckIfError(err)
fmt.Println(obj)
When trying to clone a private repo in bitbucket.org, the git directory gets corrupted. I can clone HelloWorld and make commits so the logic in that portion of the code works.
When inspecting the repo after the program runs I get the following message.
I'm wondering if this has more to do with SSH/Pageant on Windows. (I'm not a native Windows user). Can someone get me pointed in the right direction?
The text was updated successfully, but these errors were encountered: