From fa42e179c1f943d1d6ef6f85da85a541ac01a315 Mon Sep 17 00:00:00 2001 From: Ryan Patterson Date: Wed, 18 Jan 2023 12:50:29 +0400 Subject: [PATCH] Fix bug with restic 0.15 change --- Makefile | 2 +- VERSION | 2 +- cmd/git-remote-restic/repo.go | 2 +- doc/MAINTENANCE.md | 7 ++++--- fixtures/test.sh | 1 + 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 78b7bbe..83bcc3c 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ bins: gox -osarch "$(OSARCHS)" -output "bin/{{.OS}}_{{.Arch}}/git-remote-restic" $(GOFLAGS_release) $(PKG)/cmd/git-remote-restic .PHONY: release -release: $(patsubst %,bin/%.tar.gz,$(subst /,_,$(OSARCHS))) +release: test $(patsubst %,bin/%.tar.gz,$(subst /,_,$(OSARCHS))) define ruletemp $(patsubst %,bin/%.tar.gz,$(subst /,_,$(1))): $(patsubst %,bin/%/git-remote-restic,$(subst /,_,$(1))) diff --git a/VERSION b/VERSION index e9bc149..645377e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.1.14 +1.1.15 diff --git a/cmd/git-remote-restic/repo.go b/cmd/git-remote-restic/repo.go index 84db982..d948ef2 100644 --- a/cmd/git-remote-restic/repo.go +++ b/cmd/git-remote-restic/repo.go @@ -66,7 +66,7 @@ func (r *Repository) Git(allowInit bool) (*git.Repository, error) { if r.fs == nil { var parentSnapshot *restic.ID sn, err := restic.FindFilteredSnapshot(context.Background(), r.restic.Backend(), r.restic, nil, nil, nil, nil, "latest") - if err != nil && err != restic.ErrNoSnapshotFound { + if err != nil && !errors.Is(err, restic.ErrNoSnapshotFound) { return nil, err } if err == nil { diff --git a/doc/MAINTENANCE.md b/doc/MAINTENANCE.md index 2c05bba..913b894 100644 --- a/doc/MAINTENANCE.md +++ b/doc/MAINTENANCE.md @@ -9,6 +9,7 @@ - If the patch fails, use `diff -u restic/cmd/restic/global.go cmd/git-remote-restic/restic.go > scripts/update-cmd.patch` to update it. 5. Use `make test` to verify everything still works. - Use `git log -pG ` to identify commits that changed APIs that are now broken. -6. Make a commit. -7. Use `make release` to compile a new release. -8. Push everything to Github, and make a new release there. \ No newline at end of file +6. Update `VERSION` to the correct version. +7. Make a commit. +8. Use `make release` to compile a new release. +9. Push everything to Github, and make a new release there. \ No newline at end of file diff --git a/fixtures/test.sh b/fixtures/test.sh index 19e0483..229c663 100755 --- a/fixtures/test.sh +++ b/fixtures/test.sh @@ -18,6 +18,7 @@ export GIT_AUTHOR_DATE=2006-01-02T15:04:05-0700 export GIT_COMMITTER_NAME=git-restic-remote export GIT_COMMITTER_EMAIL=nobody@example.com export GIT_COMMITTER_DATE=2006-01-02T15:04:05-0700 +rm -rf restic workdir mkdir restic tar xzf restic.tar.gz git init workdir