Skip to content

Make repo.Init() accept a separate git dir #453

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

Merged
merged 3 commits into from
Jun 25, 2013
Merged

Conversation

nulltoken
Copy link
Member

Relates to http://stackoverflow.com/q/17126448

  • First blurry rough draft of an implementation
  • Cover with tests
  • Try to find a way through deprecation rather than through breaking changes
  • Make Clone() return a string instead of an instance of a Repository

Note: "Initializing a repository" and "Opening a repository" are different concerns and require different kind of parameters. Thus repo.Init() won't return a instance of a Repository any longer.

@dahlbyk
Copy link
Member

dahlbyk commented Jun 18, 2013

I think I'm missing something...why can't either workingDirectoryPath or gitDirectoryPath be a new optional parameter which, if specified, deviates from the existing sensible default behavior?

@nulltoken
Copy link
Member Author

@dahlbyk I thought about this option for a while.

However, I haven't been able to convince myself that adding this additional parameter while still accepting a RepositoryOptions.WorkingDirectoryPath was making sense.

Beside this, I think that a RepositoryOptions parameter has nothing to do to with repository initialization (nor cloning..).

@nulltoken
Copy link
Member Author

Ready for review

var scd1 = BuildSelfCleaningDirectory();
var scd2 = BuildSelfCleaningDirectory();

var gitDir = Path.Combine(scd2.DirectoryPath, ".git/");
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if it matters, but what happens if we pass ".git" at the end, without the trailing slash?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure if it matters, but what happens if we pass ".git" at the end, without the trailing slash?

@yorah Could you submit a PR with some additional test coverage regarding this?

@yorah
Copy link
Contributor

yorah commented Jun 24, 2013

👍

@nulltoken nulltoken merged commit 1b418ae into vNext Jun 25, 2013
@nulltoken nulltoken deleted the topic/init-gitdir branch June 26, 2013 17:51
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.

3 participants