Skip to content

Commit

Permalink
Merge pull request #68 from dominikschulz/fix
Browse files Browse the repository at this point in the history
[bugfix] Replace empty lines in the package description
  • Loading branch information
dominikschulz authored Dec 1, 2023
2 parents 5a36432 + e25d163 commit 320658f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
6 changes: 3 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ nfpms:
maintainer: "Gopass Authors <[email protected]>"
description: |-
gopass password manager - full featured CLI replacement for pass, designed for teams.
.
gopass is a simple but powerful password manager for your terminal. It is a
Pass implementation in Go that can be used as a drop in replacement.
.
Every secret lives inside of a gpg (or: age) encrypted textfile. These secrets
can be organized into meaninful hierachies and are by default versioned using
git.
.
This package contains git credential helper. It can be used to store git remote
credentials in a password store.
license: MIT
Expand Down
44 changes: 22 additions & 22 deletions git-credential_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,20 @@ func TestGitCredentialFormat(t *testing.T) {
for i := range data {
result, err := parseGitCredentials(data[i])
if expectsErr[i] {
assert.Error(t, err)
require.Error(t, err)
} else {
assert.NoError(t, err)
require.NoError(t, err)
}
if err != nil {
continue
}
assert.Equal(t, results[i], *result)
buf := &bytes.Buffer{}
n, err := result.WriteTo(buf)
assert.NoError(t, err, "could not serialize credentials")
require.NoError(t, err, "could not serialize credentials")
assert.Equal(t, buf.Len(), int(n))
parseback, err := parseGitCredentials(buf)
assert.NoError(t, err, "failed parsing my own output")
require.NoError(t, err, "failed parsing my own output")
assert.Equal(t, results[i], *parseback, "failed parsing my own output")
}
}
Expand All @@ -100,54 +100,54 @@ func TestGitCredentialHelper(t *testing.T) { //nolint:paralleltest
c := gptest.CliCtx(ctx, t)

// before without stdin
assert.Error(t, act.Before(c))
require.Error(t, act.Before(c))

// before with stdin
ctx = ctxutil.WithStdin(ctx, true)
c.Context = ctx
assert.NoError(t, act.Before(c))
require.NoError(t, act.Before(c))

s := "protocol=https\n" +
"host=example.com\n" +
"username=bob\n"

termio.Stdin = strings.NewReader(s)
assert.NoError(t, act.Get(c))
require.NoError(t, act.Get(c))
assert.Equal(t, "", stdout.String())

termio.Stdin = strings.NewReader(s + "password=secr3=t\n")
assert.NoError(t, act.Store(c))
require.NoError(t, act.Store(c))
stdout.Reset()

termio.Stdin = strings.NewReader(s)
assert.NoError(t, act.Get(c))
require.NoError(t, act.Get(c))
read, err := parseGitCredentials(stdout)
assert.NoError(t, err)
require.NoError(t, err)
assert.Equal(t, "secr3=t", read.Password)
stdout.Reset()

termio.Stdin = strings.NewReader("host=example.com\n")
assert.NoError(t, act.Get(c))
require.NoError(t, act.Get(c))
read, err = parseGitCredentials(stdout)
assert.NoError(t, err)
require.NoError(t, err)
assert.Equal(t, "secr3=t", read.Password)
assert.Equal(t, "bob", read.Username)
stdout.Reset()

termio.Stdin = strings.NewReader(s)
assert.NoError(t, act.Erase(c))
require.NoError(t, act.Erase(c))
assert.Equal(t, "", stdout.String())

termio.Stdin = strings.NewReader(s)
assert.NoError(t, act.Get(c))
require.NoError(t, act.Get(c))
assert.Equal(t, "", stdout.String())

termio.Stdin = strings.NewReader("a")
assert.Error(t, act.Get(c))
require.Error(t, act.Get(c))
termio.Stdin = strings.NewReader("a")
assert.Error(t, act.Store(c))
require.Error(t, act.Store(c))
termio.Stdin = strings.NewReader("a")
assert.Error(t, act.Erase(c))
require.Error(t, act.Erase(c))
}

func TestGitCredentialHelperWithStoreFlag(t *testing.T) { //nolint:paralleltest
Expand Down Expand Up @@ -176,17 +176,17 @@ func TestGitCredentialHelperWithStoreFlag(t *testing.T) { //nolint:paralleltest
"username=bob\n"

termio.Stdin = strings.NewReader(s)
assert.NoError(t, act.Get(c))
require.NoError(t, act.Get(c))
assert.Equal(t, "", stdout.String())

termio.Stdin = strings.NewReader(s + "password=secr3=t\n")
assert.NoError(t, act.Store(c))
require.NoError(t, act.Store(c))
stdout.Reset()

termio.Stdin = strings.NewReader(s)
assert.NoError(t, act.Get(c))
require.NoError(t, act.Get(c))
read, err := parseGitCredentials(stdout)
assert.NoError(t, err)
require.NoError(t, err)
assert.Equal(t, "secr3=t", read.Password)
stdout.Reset()

Expand All @@ -195,7 +195,7 @@ func TestGitCredentialHelperWithStoreFlag(t *testing.T) { //nolint:paralleltest
})

termio.Stdin = strings.NewReader(s)
assert.NoError(t, act.Get(c))
require.NoError(t, act.Get(c))
assert.Equal(t, "", stdout.String())
}

Expand Down

0 comments on commit 320658f

Please sign in to comment.