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

Allow directory to be provided as final arg #15

Merged
merged 3 commits into from
Apr 26, 2019
Merged

Conversation

drewwyatt
Copy link
Owner

@drewwyatt drewwyatt commented Apr 26, 2019

  • Git now has a constructor that takes a directory
  • Directory is used for every command executed by execGitCommand
  • Pass flag.Arg(0) to new Git constructor in main

- Git now has a constructor that takes a directory
- Directory is used for every command executed by execGitCommand
@drewwyatt drewwyatt mentioned this pull request Apr 26, 2019
@drewwyatt drewwyatt added this to the 0.3.0 milestone Apr 26, 2019
}

// NewExecutor Constructor for git executor
func NewExecutor(directory string) Git {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it weird that this returns a Git, but your other functions take/return a *Git?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually tried returning a *Git first, and the compiler complained.

The way I have come to understand this is that NewExecutor returns a Git, because it is creating a new instance that isn't yet being referenced anywhere? (this may be flawed reasoning)

@drewwyatt drewwyatt merged commit 4d9a025 into master Apr 26, 2019
@drewwyatt drewwyatt deleted the dw/directory branch April 27, 2019 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants