Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
Default to origin master for git pull (gopasspw#819)
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikschulz authored May 31, 2018
1 parent 411be84 commit 71f9ad6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 0 additions & 1 deletion commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ var commandsWithError = map[string]struct{}{
".edit": {},
".find": {},
".generate": {},
".git.pull": {},
".git.push": {},
".git.remote.add": {},
".git.remote.remove": {},
Expand Down
7 changes: 5 additions & 2 deletions pkg/action/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,11 @@ func (s *Action) GitPull(ctx context.Context, c *cli.Context) error {
origin := c.Args().Get(0)
branch := c.Args().Get(1)

if origin == "" || branch == "" {
return ExitError(ctx, ExitUsage, nil, "Usage: %s git pull <ORIGIN> <BRANCH>", s.Name)
if origin == "" {
origin = "origin"
}
if branch == "" {
branch = "master"
}
return s.Store.GitPull(ctx, store, origin, branch)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/action/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func TestGit(t *testing.T) {
buf.Reset()

// GitPull
assert.Error(t, act.GitPull(ctx, c))
assert.NoError(t, act.GitPull(ctx, c))
buf.Reset()

// GitPush
Expand Down

0 comments on commit 71f9ad6

Please sign in to comment.