Skip to content
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

empty git-upload-pack given errors since v5.4.0 #328

Closed
hiddeco opened this issue Jun 2, 2021 · 34 comments · Fixed by #932
Closed

empty git-upload-pack given errors since v5.4.0 #328

hiddeco opened this issue Jun 2, 2021 · 34 comments · Fixed by #932
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@hiddeco
Copy link
Member

hiddeco commented Jun 2, 2021

We are extensive consumers of this library and besides the issue reported in #323, we have seen an increase of empty git-upload-pack given errors reported by our users since we upgraded from v5.3.0 to v5.4.x.

The error seems unrelated to the Git v2 protocol as reported in #64 or #157, given users that previously were able to perform operations on their e.g. GitHub repository using v5.3.0 are now no longer able to do so using v5.4.x.

Diving into the changelog nothing directly related seems to have changed, except for some plumbing changes in #246.

@zeripath
Copy link
Contributor

zeripath commented Jun 2, 2021

I think this should be fixed following the merging of #329

@mcuadros
Copy link
Member

mcuadros commented Jun 2, 2021

Can you test this against the new v5.4.2?

@hiddeco
Copy link
Member Author

hiddeco commented Jun 2, 2021

Based on fluxcd/image-automation-controller#176 (comment), this does not seem to have been the cause.

@Robbilie
Copy link

Robbilie commented Jun 2, 2021

looking at the MR, we are facing this issue with a basically fresh repo, single branch, ~10 super simple yaml files, nothing really big in any way

@zeripath
Copy link
Contributor

zeripath commented Aug 6, 2021

I think this can be closed now?

@laszlocph
Copy link

laszlocph commented Aug 12, 2021

@zeripath I still get this error with v5.4.2

With the following scenario:

opts := &git.CloneOptions{
		URL: fmt.Sprintf("%s/%s", "https://github.com", repoName),
		Auth: &http.BasicAuth{
			Username: user,
			Password: token,
		},
		Depth: 100,
	}
repo, err := git.PlainClone(repoPath, false, opts)
err = repo.Fetch(&git.FetchOptions{
		RefSpecs: []config.RefSpec{"refs/*:refs/*", "HEAD:refs/heads/HEAD"},
		Auth: &http.BasicAuth{
			Username: user,
			Password: token,
		},
		Depth: 100,
	})
repo, err := git.PlainOpen(path)
worktree.Pull(&git.PullOptions{
		RemoteName: "origin",
		Auth: &http.BasicAuth{
			Username: user,
			Password: token,
		},
	})

Currently running v5.3.0 as a workaround, where this works.

@zeripath
Copy link
Contributor

Ok then I don't think this can be related to my changes. If you have a specific and repeatable test case you could try to bisect?

@qhua948
Copy link

qhua948 commented Aug 18, 2021

Same problem here, first clone went ok, same problem when doing subsequent pull/fetch

@linneawang
Copy link

Same problem here, first clone went ok, same problem when doing subsequent pull/fetch

same here

1 similar comment
@takirala
Copy link

takirala commented Sep 8, 2021

Same problem here, first clone went ok, same problem when doing subsequent pull/fetch

same here

@laszlocph
Copy link

@zeripath The following test fails with empty git-upload-pack given, just replace xxx with a valid git personal token.

package worker

import (
	"github.com/go-git/go-git/v5"
	"github.com/go-git/go-git/v5/plumbing/transport/http"
	"github.com/stretchr/testify/assert"
	"os"
	"testing"
)

func Test_emptyUploadPack(t *testing.T) {
	repoPath := "/tmp/deleteme"
	os.RemoveAll(repoPath)
	os.MkdirAll(repoPath, 0777)

	token := "xxx"
	user := "abc123"

	opts := &git.CloneOptions{
		URL: "https://github.com/go-git/go-git",
		Auth: &http.BasicAuth{
			Username: user,
			Password: token,
		},
		Depth: 1,
		Tags:  git.NoTags,
	}

	repo, err := git.PlainClone(repoPath, false, opts)
	assert.Nil(t, err)

	err = repo.Fetch(&git.FetchOptions{
		Auth: &http.BasicAuth{
			Username: user,
			Password: token,
		},
		Depth: 1,
		Tags:  git.NoTags,
	})
	if err != nil && err != git.NoErrAlreadyUpToDate {
		t.Errorf(err.Error())
	}
}

@laszlocph
Copy link

The issue started with 320db9a

Works before

$ go get github.com/go-git/go-git/v5@db2bc57350561c4368a8d32c42476699b48d2a09
go get: downgraded github.com/go-git/go-git/v5 v5.3.1-0.20210512203949-320db9af8ba8 => v5.3.1-0.20210503000431-db2bc5735056
$ laszlo@laszlo-XPS-13-9370:~/projects/empty-uploadpack$ go test
PASS
ok  	github.com/laszlocph/empty-upload-pack	1.847s

Fails afterwards:

$laszlo@laszlo-XPS-13-9370:~/projects/empty-uploadpack$ go get github.com/go-git/go-git/v5@320db9af8ba8b0046e833013504eb07c61a3573c
go get: upgraded github.com/go-git/go-git/v5 v5.3.1-0.20210503000431-db2bc5735056 => v5.3.1-0.20210512203949-320db9af8ba8
$ laszlo@laszlo-XPS-13-9370:~/projects/empty-uploadpack$ go test
--- FAIL: Test_emptyUploadPack (1.50s)
    uploadpack_test.go:41: empty git-upload-pack given
FAIL
exit status 1
FAIL	github.com/laszlocph/empty-upload-pack	1.509s

@greenpau
Copy link

Have the same issue greenpau/caddy-git#2 when using PlainOpen() followed by worktree Pull().

@greenpau
Copy link

greenpau commented Jan 12, 2022

The empty git-upload-pack given is being returned by remote.fetch call in PullContext().

go-git/worktree.go

Lines 73 to 82 in a5bbcd2

fetchHead, err := remote.fetch(ctx, &FetchOptions{
RemoteName: o.RemoteName,
RemoteURL: o.RemoteURL,
Depth: o.Depth,
Auth: o.Auth,
Progress: o.Progress,
Force: o.Force,
InsecureSkipTLS: o.InsecureSkipTLS,
CABundle: o.CABundle,
})

The fetch() returns error from fetchPack here:

go-git/remote.go

Lines 463 to 465 in a5bbcd2

if err = r.fetchPack(ctx, o, s, req); err != nil {
return nil, err
}

The fetchPack returns error from transport.UploadPackSession.UploadPack:

go-git/remote.go

Lines 547 to 550 in a5bbcd2

reader, err := s.UploadPack(ctx, req)
if err != nil {
return err
}

The UploadPackSession is an interface and it has UploadPack method:

// UploadPackSession represents a git-upload-pack session.
// A git-upload-pack session has two steps: reference discovery
// (AdvertisedReferences) and uploading pack (UploadPack).
type UploadPackSession interface {
Session
// UploadPack takes a git-upload-pack request and returns a response,
// including a packfile. Don't be confused by terminology, the client
// side of a git-upload-pack is called git-fetch-pack, although here
// the same interface is used to make it RPC-like.
UploadPack(context.Context, *packp.UploadPackRequest) (*packp.UploadPackResponse, error)
}

The UploadPack returns transport.ErrEmptyUploadPackRequest, because the req in remote.go passes an empty request.

func (s *upSession) UploadPack(
ctx context.Context, req *packp.UploadPackRequest,
) (*packp.UploadPackResponse, error) {
if req.IsEmpty() {
return nil, transport.ErrEmptyUploadPackRequest
}

The UploadPackRequest is empty when Haves are contained in the Wants, or if Wants length is zero:

// IsEmpty a request if empty if Haves are contained in the Wants, or if Wants
// length is zero
func (r *UploadPackRequest) IsEmpty() bool {
return isSubset(r.Wants, r.Haves)
}

🤔 should we modify remote.go such that when the req is empty, then we don't do UploadPack()?

greenpau added a commit to greenpau/go-git that referenced this issue Jan 12, 2022
More info: This change prevents an attempt to upload pack
when UploadPackRequest is empty.

Partial Resolution: go-git#328

Signed-off-by: Paul Greenberg <greenpau@outlook.com>
@ydcool
Copy link

ydcool commented Apr 2, 2022

Got same issue. I have to downgrade to v5.3.0, what's the progress now?

@talwat
Copy link

talwat commented Apr 15, 2022

I also have the same issue, v5.3.0 seems to work but I'm worried about using an older version. Is there any kind of workaround?

@greenpau
Copy link

@ydcool , @talwat , I am solving the issue by not specifying depth.

@talwat
Copy link

talwat commented Apr 15, 2022

Yes, but limiting depth is super useful and I need it. If I don’t specify depth my program is way slower.

@loxia-byte
Copy link

Got same issue. I have to downgrade to v5.3.0, what's the progress now?

Same here.

@mmessmore
Copy link

I wasn't specifying Depth on the Pull(), but was on the initial Clone() and get this error on any subsequent Pull().

If I remove specifying Depth on the Clone(), the Pull()s work fine.

This is not ideal for me since my service is useless until the initial clone is complete and making it shallower reduces that time. The repo I'm working with has a very long (and mostly irrelevant) history, so I was trying to limit that initial transfer. I just need the last couple weeks of changes at a given point in time.

rohankmr414 pushed a commit to rohankmr414/go-git that referenced this issue Oct 22, 2022
More info: This change prevents an attempt to upload pack
when UploadPackRequest is empty.

Partial Resolution: go-git#328

Signed-off-by: Paul Greenberg <greenpau@outlook.com>
Gerrit91 added a commit to metal-stack/metal-robot that referenced this issue Dec 8, 2022
@Charles546
Copy link

Hey team, what is going on here? Are we not going to fix this?

AriehSchneier added a commit to AriehSchneier/go-git that referenced this issue Jun 15, 2023
…go-git#328

Signed-off-by: Arieh Schneier <15041913+AriehSchneier@users.noreply.github.com>
@pjbgf pjbgf closed this as completed in 025e131 Jul 2, 2023
pjbgf added a commit that referenced this issue Jul 2, 2023
plumbing: packp, A request is not empty if it contains shallows. Fixes #328
@taigrr
Copy link

taigrr commented Jul 16, 2023

These changes did end up fixing the issue I was having in one of my repos.

Any chance we could get a new version tagged release so we can go get -u ?

Thanks in advance, go-git team.

@pjbgf
Copy link
Member

pjbgf commented Jul 23, 2023

@taigrr The version v5.8.0 was released last week and should contain the fix.

@williambanfield
Copy link

williambanfield commented Jul 26, 2023

Using Version 5.8.0

Hey, I think there may still be an issue here. It appears that this fails if I don't specify a Depth in the Pull function. If I run the command line git pull within a shallow cloned directory, the pull succeeds.

The reason this is valuable is that specifying Depth will cause the Pull to fail if the the number of commits between the local HEAD and the remote HEAD is greater than the depth. This happens because git cannot determine that the fetched commits are descendants of the local branch. Command line git appears to pull enough commits to determine the ancestry, which was the behavior I was hoping would exist here. However, when I run without the Depth specified, I run into the same empty git-upload-pack given error.

Let me know if I'm misunderstanding something.

The following script reproduces the issue by panic'ing on the error from Pull:

package main

import (
	"os"
	"strings"

	gogit "github.com/go-git/go-git/v5"
	"github.com/go-git/go-git/v5/plumbing/transport/http"
)

func main() {
	t := os.Getenv("GITHUB_API_TOKEN")

	auth := &http.BasicAuth{
		Username: "username",
		Password: strings.TrimSuffix(t, "\n"),
	}

	cloneOptions := gogit.CloneOptions{
		Auth:         auth,
		URL:          "xxx",
		SingleBranch: true,
		Depth:        1,
	}

	d, err := os.MkdirTemp("", "")
	if err != nil {
		panic(err)
	}
	defer os.RemoveAll(d)
	repo, err := gogit.PlainClone(d, false, &cloneOptions)
	if err != nil {
		panic(err)
	}
	w, err := repo.Worktree()
	if err != nil {
		panic(err)
	}
	err = w.Pull(&gogit.PullOptions{
		Auth: auth,
	})
	if err != nil && err != gogit.NoErrAlreadyUpToDate {
		panic(err)
	}
}

@AriehSchneier
Copy link
Contributor

@pjbgf I took a look and this case is different to what I fixed. This is trying to unshallow a repo after it was cloned as shallow. If you add this code to the end of TestFetchAfterShallowClone it reproduces the issue:

	// Try fetch with no depth specified to unshallow
	s.testFetch(c, r, &FetchOptions{
		Tags: NoTags,

		RefSpecs: []config.RefSpec{
			"+refs/heads/master:refs/heads/master",
			"+refs/heads/master:refs/remotes/origin/master",
		},
	}, []*plumbing.Reference{
		plumbing.NewReferenceFromStrings("refs/heads/master", sha5.String()),
		plumbing.NewReferenceFromStrings("refs/remotes/origin/master", sha5.String()),
		plumbing.NewSymbolicReference("HEAD", "refs/heads/master"),
	})

It seems we are only handling shallow commits if we are requesting a depth greater than 0, so it fails if we try to unshallow our clone.

In Remote.fetch I tried changing this section:

	if !req.Depth.IsZero() {
		req.Shallows, err = r.s.Shallow()
		if err != nil {
			return nil, fmt.Errorf("existing checkout is not shallow")
		}
	}

to

	req.Shallows, err = r.s.Shallow()
	if err != nil && !req.Depth.IsZero() {
		return nil, fmt.Errorf("existing checkout is not shallow")
	} else if len(req.Shallows) > 0 && req.Depth.IsZero() {
		// trying to unshallow, need to set the shallow capability
		if err := req.Capabilities.Set(capability.Shallow); err != nil {
			return nil, err
		}
	}

However it seems we don't update the existing list of shallows correctly (ie remove commits that are no longer shallow) during fetchPack and I don't know the git protocol well enough to know what is missing from the code.

Any chance you can take a look?

@pjbgf
Copy link
Member

pjbgf commented Jul 31, 2023

@AriehSchneier I will try to take a look at it later on this week. In the meantime, will re-open this issue.

@pjbgf pjbgf reopened this Jul 31, 2023
@pjbgf
Copy link
Member

pjbgf commented Aug 6, 2023

@AriehSchneier I had an initial look at this, by shallow cloning the repo then unshallowing it:

GIT_TRACE_PACKET=true git -c protocol.version=1 clone --no-progress --no-tags --depth 1 --single-branch https://github.com/go-git/go-git

GIT_TRACE_PACKET=true git -c protocol.version=1 fetch --no-progress --unshallow

On the fetch (trying to unshallow), go-git does not seem to be sending that shallow and deepen across:

09:32:38.194674 pkt-line.c:86           packet:   fetch-pack> want cd6170c6f808453f58dcfd15c6c59345e3df402b multi_ack_detailed no-done side-band-64k thin-pack no-progress ofs-delta deepen-since deepen-not agent=git/2.41.0
09:32:38.194680 pkt-line.c:86           packet:   fetch-pack> shallow cd6170c6f808453f58dcfd15c6c59345e3df402b
09:32:38.194683 pkt-line.c:86           packet:   fetch-pack> deepen 2147483647
09:32:38.194685 pkt-line.c:86           packet:   fetch-pack> 0000

Which means it would not receive the unshallow back:

09:32:38.194741 pkt-line.c:86           packet:          git< 00a4want cd6170c6f808453f58dcfd15c6c59345e3df402b multi_ack_detailed no-done side-band-64k thin-pack no-progress ofs-delta deepen-since deepen-not agent=git/2.41.00034shallow cd6170c6f808453f58dcfd15c6c59345e3df402b0015deepen 21474836470000
09:32:38.194751 pkt-line.c:86           packet:          git< 0000
09:32:38.343729 pkt-line.c:86           packet:   fetch-pack< unshallow cd6170c6f808453f58dcfd15c6c59345e3df402b
09:32:38.343766 pkt-line.c:86           packet:   fetch-pack< 0000

@pjbgf
Copy link
Member

pjbgf commented Aug 6, 2023

@williambanfield Just wanted to call out on your example that you probably want to add Tags: git.NoTags on your CloneOptions, as that will impact the amount of commits you will be shallowing as it will bring depth + the number of unique referenced commits from all the tags within the repository. You can check that with cat .git/shallow.

@Tang8330
Copy link

Tang8330 commented Sep 15, 2023

Still getting this error when going a clone with a depth specified, then running git pull without depth on v5.9

zydou pushed a commit to zydou/tea that referenced this issue Sep 25, 2023
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/go-git/go-git/v5](https://github.com/go-git/go-git) | require | minor | `v5.4.2` -> `v5.8.1` |

---

### ⚠ Dependency Lookup Warnings ⚠

Warnings were logged while processing this repo. Please check the Dependency Dashboard for more information.

---

### Release Notes

<details>
<summary>go-git/go-git (github.com/go-git/go-git/v5)</summary>

### [`v5.8.1`](https://github.com/go-git/go-git/releases/tag/v5.8.1)

[Compare Source](go-git/go-git@v5.8.0...v5.8.1)

#### What's Changed

-   \*: Bump dependencies by [@&#8203;pjbgf](https://github.com/pjbgf) in go-git/go-git#815

**Full Changelog**: go-git/go-git@v5.8.0...v5.8.1

### [`v5.8.0`](https://github.com/go-git/go-git/releases/tag/v5.8.0)

[Compare Source](go-git/go-git@v5.7.0...v5.8.0)

#### What's Changed

-   git: Fix fetching after shallow clone. Fixes [#&#8203;305](go-git/go-git#305) by [@&#8203;AriehSchneier](https://github.com/AriehSchneier) in go-git/go-git#778
-   git: enable fetch with unqualified references by [@&#8203;AriehSchneier](https://github.com/AriehSchneier) in go-git/go-git#762
-   git: don't add to want if exists, shallow and depth 1 by [@&#8203;AriehSchneier](https://github.com/AriehSchneier) in go-git/go-git#763
-   git: Clone HEAD should not force master. Fixes [#&#8203;363](go-git/go-git#363) by [@&#8203;AriehSchneier](https://github.com/AriehSchneier) in go-git/go-git#758
-   git: fix the issue with submodules having the SCP style URL fail due to the wrong URL parsing by [@&#8203;matejrisek](https://github.com/matejrisek) in go-git/go-git#756
-   git: add a clone option to allow for shallow cloning of submodules by [@&#8203;matejrisek](https://github.com/matejrisek) in go-git/go-git#765
-   worktree: minor speedup for `doAddDirectory` by [@&#8203;ThinkChaos](https://github.com/ThinkChaos) in go-git/go-git#702
-   \_examples: Remove wrong comment by [@&#8203;pascal-hofmann](https://github.com/pascal-hofmann) in go-git/go-git#357
-   \*: Handle paths starting with tilde by [@&#8203;ricci2511](https://github.com/ricci2511) in go-git/go-git#808
-   \*: Handle paths starting with ~Username by [@&#8203;AriehSchneier](https://github.com/AriehSchneier) in go-git/go-git#809
-   storage: filesystem/dotgit, add support for tmp_objdir prefix by [@&#8203;L11R](https://github.com/L11R) in go-git/go-git#812
-   plumbing: gitignore, replace user dir in path by [@&#8203;Jleagle](https://github.com/Jleagle) in go-git/go-git#772
-   plumbing: gitignore, fix incorrect parsing. Fixes [#&#8203;500](go-git/go-git#500) by [@&#8203;AriehSchneier](https://github.com/AriehSchneier) in go-git/go-git#781
-   plumbing: http, Fix empty repos on Git v2.41+ by [@&#8203;pjbgf](https://github.com/pjbgf) in go-git/go-git#802
-   plumbing: packp, A request is not empty if it contains shallows. Fixes [#&#8203;328](go-git/go-git#328) by [@&#8203;AriehSchneier](https://github.com/AriehSchneier) in go-git/go-git#792
-   plumbing: blame, Complete rewrite. Fixes [#&#8203;603](go-git/go-git#603) by [@&#8203;AriehSchneier](https://github.com/AriehSchneier) in go-git/go-git#789
-   plumbing: gitignore, Allow gitconfig to contain a gitignore relative to any user home. Fixes [#&#8203;578](go-git/go-git#578) by [@&#8203;AriehSchneier](https://github.com/AriehSchneier) in go-git/go-git#785

#### New Contributors

-   [@&#8203;Jleagle](https://github.com/Jleagle) made their first contribution in go-git/go-git#772
-   [@&#8203;pascal-hofmann](https://github.com/pascal-hofmann) made their first contribution in go-git/go-git#357
-   [@&#8203;ricci2511](https://github.com/ricci2511) made their first contribution in go-git/go-git#808
-   [@&#8203;L11R](https://github.com/L11R) made their first contribution in go-git/go-git#812

**Full Changelog**: go-git/go-git@v5.7.0...v5.7.1

### [`v5.7.0`](https://github.com/go-git/go-git/releases/tag/v5.7.0)

[Compare Source](go-git/go-git@v5.6.1...v5.7.0)

#### What's Changed

-   \*: Add support for initializing SHA256 repositories by [@&#8203;pjbgf](https://github.com/pjbgf) in go-git/go-git#707
-   git: add mirror clone option by [@&#8203;aymanbagabas](https://github.com/aymanbagabas) in go-git/go-git#735
-   git: Add support to ls-remote with peeled references. Fixes [#&#8203;749](go-git/go-git#749) by [@&#8203;pjbgf](https://github.com/pjbgf) in go-git/go-git#750
-   git: fix cloning with branch name by [@&#8203;AriehSchneier](https://github.com/AriehSchneier) in go-git/go-git#755
-   git: Worktree, add check to see if file already checked in. Fixes [#&#8203;718](go-git/go-git#718) by [@&#8203;cbbm142](https://github.com/cbbm142) in go-git/go-git#719
-   git: Worktree, git grep bare repositories by [@&#8203;aymanbagabas](https://github.com/aymanbagabas) in go-git/go-git#728
-   git: Add Depth to SubmoduleUpdateOptions by [@&#8203;matejrisek](https://github.com/matejrisek) in go-git/go-git#754
-   git: Testing, Fix tests not cleaning temp folders by [@&#8203;AriehSchneier](https://github.com/AriehSchneier) in go-git/go-git#769
-   git: remote, add support for a configurable timeout. by [@&#8203;andrewpollock](https://github.com/andrewpollock) in go-git/go-git#753
-   git: Allow Initial Branch to be configurable by [@&#8203;techknowlogick](https://github.com/techknowlogick) in go-git/go-git#764
-   storage: filesystem/dotgit, Improve load packed-refs by [@&#8203;fcharlie](https://github.com/fcharlie) in go-git/go-git#743
-   storage: filesystem, Populate index before use. Fixes [#&#8203;148](go-git/go-git#148) by [@&#8203;AriehSchneier](https://github.com/AriehSchneier) in go-git/go-git#722
-   plumbing: resolve non-external delta references by [@&#8203;ZauberNerd](https://github.com/ZauberNerd) in go-git/go-git#485
-   plumbing/transport: fix regression in scp-like match by [@&#8203;jotadrilo](https://github.com/jotadrilo) in go-git/go-git#715
-   plumbing/transport: Add support for custom proxy settings by [@&#8203;aryan9600](https://github.com/aryan9600) in go-git/go-git#744
-   \*: small fixes across the codebase by [@&#8203;pjbgf](https://github.com/pjbgf) in go-git/go-git#770
-   \*: bump github.com/cloudflare/circl from 1.1.0 to 1.3.3 by [@&#8203;dependabot](https://github.com/dependabot) in go-git/go-git#776
-   \*: bump dependencies by [@&#8203;pjbgf](https://github.com/pjbgf) in go-git/go-git#748
-   \*: bump Go version to 1.18 on go.mod by [@&#8203;pjbgf](https://github.com/pjbgf) in go-git/go-git#774
-   \*: add Codeql workflow and bump dependencies by [@&#8203;pjbgf](https://github.com/pjbgf) in go-git/go-git#775
-   ci: fix upstream git build for master branch by [@&#8203;pjbgf](https://github.com/pjbgf) in go-git/go-git#739

#### New Contributors

-   [@&#8203;ZauberNerd](https://github.com/ZauberNerd) made their first contribution in go-git/go-git#485
-   [@&#8203;jotadrilo](https://github.com/jotadrilo) made their first contribution in go-git/go-git#715
-   [@&#8203;fcharlie](https://github.com/fcharlie) made their first contribution in go-git/go-git#743
-   [@&#8203;AriehSchneier](https://github.com/AriehSchneier) made their first contribution in go-git/go-git#755
-   [@&#8203;cbbm142](https://github.com/cbbm142) made their first contribution in go-git/go-git#719
-   [@&#8203;aryan9600](https://github.com/aryan9600) made their first contribution in go-git/go-git#744
-   [@&#8203;matejrisek](https://github.com/matejrisek) made their first contribution in go-git/go-git#754
-   [@&#8203;andrewpollock](https://github.com/andrewpollock) made their first contribution in go-git/go-git#753
-   [@&#8203;techknowlogick](https://github.com/techknowlogick) made their first contribution in go-git/go-git#764

**Full Changelog**: go-git/go-git@v5.6.1...v5.7.0

### [`v5.6.1`](https://github.com/go-git/go-git/releases/tag/v5.6.1)

[Compare Source](go-git/go-git@v5.6.0...v5.6.1)

#### What's Changed

-   plumbing/transport: don't use the `firstErrLine` when it is empty by [@&#8203;ThinkChaos](https://github.com/ThinkChaos) in go-git/go-git#682
-   plumbing/transport: ssh, unable to pass a custom HostKeyCallback func by [@&#8203;aymanbagabas](https://github.com/aymanbagabas) in go-git/go-git#655
-   storage/filesystem: dotgit: fix a filesystem race in Refs/walkReferencesTree by [@&#8203;MichaelMure](https://github.com/MichaelMure) in go-git/go-git#659
-   \*: bump golang.org/x/net from 0.2.0 to 0.7.0 by [@&#8203;dependabot](https://github.com/dependabot) in go-git/go-git#684
-   \*: bump dependencies by [@&#8203;pjbgf](https://github.com/pjbgf) in go-git/go-git#697
-   \*: fix panic for empty revisions by [@&#8203;pjbgf](https://github.com/pjbgf) in go-git/go-git#696
-   ci: bump GitHub actions, enable go test race detection and stop using developer's GPG keys during test execution by [@&#8203;pjbgf](https://github.com/pjbgf) in go-git/go-git#701

**Full Changelog**: go-git/go-git@v5.6.0...v5.6.1

### [`v5.6.0`](https://github.com/go-git/go-git/releases/tag/v5.6.0)

[Compare Source](go-git/go-git@v5.5.2...v5.6.0)

#### What's Changed

-   Worktree, check for empty parent dirs during Reset (Fixes [#&#8203;670](go-git/go-git#670)) by [@&#8203;mbohy](https://github.com/mbohy) in go-git/go-git#671
-   \*: remove need to build with CGO by [@&#8203;pjbgf](https://github.com/pjbgf) in go-git/go-git#688
-   plumbing: support SSH/X509 signed tags by [@&#8203;hiddeco](https://github.com/hiddeco) in go-git/go-git#690

**Full Changelog**: go-git/go-git@v5.5.2...v5.6.0

### [`v5.5.2`](https://github.com/go-git/go-git/releases/tag/v5.5.2)

[Compare Source](go-git/go-git@v5.5.1...v5.5.2)

#### What's Changed

-   \*: update go-billy v5.4.0, removes data races. Fixes [#&#8203;629](go-git/go-git#629) by [@&#8203;mcuadros](https://github.com/mcuadros) in go-git/go-git#653
-   Worktree: Add, fix add removed files. Fixes [#&#8203;223](go-git/go-git#223) by [@&#8203;tfujiwar](https://github.com/tfujiwar) in go-git/go-git#652

**Full Changelog**: go-git/go-git@v5.5.1...v5.5.2

### [`v5.5.1`](https://github.com/go-git/go-git/releases/tag/v5.5.1)

[Compare Source](go-git/go-git@v5.5.0...v5.5.1)

#### What's Changed

-   \*: fix error when building with `CGO_ENABLED=0` by [@&#8203;pjbgf](https://github.com/pjbgf) in go-git/go-git#625
-   plumbing: transport/ssh: fix panic on Windows 10 with paegent as ssh-agent by [@&#8203;doxsch](https://github.com/doxsch) in go-git/go-git#617
-   CommitOptions: AllowEmptyCommits, return an error instead of creating empty commits by [@&#8203;pjbgf](https://github.com/pjbgf) in go-git/go-git#623

**Full Changelog**: go-git/go-git@v5.5.0...v5.5.1

### [`v5.5.0`](https://github.com/go-git/go-git/releases/tag/v5.5.0)

[Compare Source](go-git/go-git@v5.4.2...v5.5.0)

#### What's Changed

-   \*: add collision resistent SHA1 implementation by [@&#8203;pjbgf](https://github.com/pjbgf) in go-git/go-git#618
-   \*: replace go-homedir with os.UserHomeDir by [@&#8203;mvdan](https://github.com/mvdan) in go-git/go-git#535
-   Remote: add RemoteURL to {Fetch,Pull,Push}Options by [@&#8203;noerw](https://github.com/noerw) in go-git/go-git#375
-   Remote: Push, add support to push commits per hashes by [@&#8203;tjamet](https://github.com/tjamet) in go-git/go-git#325
-   Remote: Push, add ForceWithLease Push Option by [@&#8203;john-cai](https://github.com/john-cai) in go-git/go-git#404
-   Remote: PushOptions add push-options by [@&#8203;S-Bohn](https://github.com/S-Bohn) in go-git/go-git#399
-   Remote: Push, add atomic to push options by [@&#8203;john-cai](https://github.com/john-cai) in go-git/go-git#406
-   Remote: add FollowTags option for pushes by [@&#8203;john-cai](https://github.com/john-cai) in go-git/go-git#385
-   Worktree: use syscall.Timespec.Unix by [@&#8203;tklauser](https://github.com/tklauser) in go-git/go-git#437
-   Worktree: Checkout, simplified sparse checkout by [@&#8203;john-cai](https://github.com/john-cai) in go-git/go-git#410
-   Repository: don't crash accessing invalid pathinfo by [@&#8203;muesli](https://github.com/muesli) in go-git/go-git#443
-   storage: filesystem, switch from os.SEEK_\* to io.Seek\* by [@&#8203;abhinav](https://github.com/abhinav) in go-git/go-git#421
-   config: add branch description support by [@&#8203;ninedraft](https://github.com/ninedraft) in go-git/go-git#409
-   revision: fix endless looping in revision parser by [@&#8203;michenriksen](https://github.com/michenriksen) in go-git/go-git#475
-   pumbling: optimise zlib reader and consolidate sync.Pools by [@&#8203;pjbgf](https://github.com/pjbgf) in go-git/go-git#608
-   pumbling: parse optimisations by [@&#8203;pjbgf](https://github.com/pjbgf) in go-git/go-git#602
-   plumbing: object, rename calculation uses too much memory by [@&#8203;jfontan](https://github.com/jfontan) in go-git/go-git#503
-   plumbing: protocol/pakp and server, include the contents of `GO_GIT_USER_AGENT_EXTRA`. Fixes [#&#8203;529](go-git/go-git#529) by [@&#8203;stewing](https://github.com/stewing) in go-git/go-git#531
-   plumbing: protocol/pakp, avoid duplicate encoding when overriding a Capability value. by [@&#8203;tylerchr](https://github.com/tylerchr) in go-git/go-git#521
-   plumbing: protocol/pakp, update agent by [@&#8203;caarlos0](https://github.com/caarlos0) in go-git/go-git#453
-   plumbing: protocol/pakp: Actions should have type Action by [@&#8203;abhinav](https://github.com/abhinav) in go-git/go-git#420
-   plumbing: protocol/pakp: allow unsupported `multi_ack` capability by [@&#8203;pjbgf](https://github.com/pjbgf) in go-git/go-git#613
-   plumbing: transport/ssh, auto-populate HostKeyAlgorithms. Fixes [#&#8203;411](go-git/go-git#411) by [@&#8203;evanelias](https://github.com/evanelias) in go-git/go-git#548
-   pumbling: format/packfile, resolve external reference delta by [@&#8203;ga-paul-t](https://github.com/ga-paul-t) in go-git/go-git#392
-   plumbing: format/packfile, prevent large objects from being read into memory completely by [@&#8203;zeripath](https://github.com/zeripath) in go-git/go-git#330
-   plumbing: format/index, support v3 index by [@&#8203;john-cai](https://github.com/john-cai) in go-git/go-git#407
-   plumbing: format/gitignore, Read .git/info/exclude file too. by [@&#8203;enisdenjo](https://github.com/enisdenjo) in go-git/go-git#402
-   plumbing: format/gitattributes, Avoid index out of range  by [@&#8203;To1ne](https://github.com/To1ne) in go-git/go-git#598
-   plumbing: format/config, Branch name with hash can be cloned. Fixes [#&#8203;309](go-git/go-git#309) by [@&#8203;dowy](https://github.com/dowy) in go-git/go-git#354
-   go.mod: update github.com/xanzy/ssh-agent to v0.3.1 by [@&#8203;tklauser](https://github.com/tklauser) in go-git/go-git#403
-   go.mod: update dependencies to remove supply chain CVEs by [@&#8203;pjbgf](https://github.com/pjbgf) in go-git/go-git#620
-   examples: added "tag find if head is tagged" by [@&#8203;snebel29](https://github.com/snebel29) in go-git/go-git#374
-   examples: remote fix typo by [@&#8203;nep-0](https://github.com/nep-0) in go-git/go-git#408

**Full Changelog**: go-git/go-git@v5.4.2...v5.5.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi43OS4xIiwidXBkYXRlZEluVmVyIjoiMzYuNzkuMSIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Reviewed-on: https://gitea.com/gitea/tea/pulls/578
Co-authored-by: Renovate Bot <renovate-bot@gitea.com>
Co-committed-by: Renovate Bot <renovate-bot@gitea.com>
@Xe
Copy link

Xe commented Oct 28, 2023

I just ran into this today

@pjbgf pjbgf added bug Something isn't working help wanted Extra attention is needed labels Nov 3, 2023
aymanbagabas added a commit to aymanbagabas/go-git that referenced this issue Nov 16, 2023
If we have all what we asked for, finish the session and handle error.

This is equivalent of git "Already up to date." message.

Fixes: go-git#328
Fixes: go-git#638
aymanbagabas added a commit to aymanbagabas/go-git that referenced this issue Nov 16, 2023
If we have all what we asked for, finish the session and handle error.

This is equivalent of git "Already up to date." message.

Fixes: go-git#328
Fixes: go-git#638
Fixes: go-git#157
aymanbagabas added a commit to aymanbagabas/go-git that referenced this issue Nov 16, 2023
If we have all what we asked for, finish the session and handle error.

This is equivalent of git "Already up to date." message.

Fixes: go-git#328
Fixes: go-git#638
Fixes: go-git#157
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.