-
-
Notifications
You must be signed in to change notification settings - Fork 456
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
git: add support for bare repositories and GIT_CEILING_DIRECTORIES #547
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: David Aguilar <davvid@gmail.com>
Simlify the logic to have a single exit point. Signed-off-by: David Aguilar <davvid@gmail.com>
Support working in a bare repository by avoiding worktree paths. There are a few places where we want the current directory, and were doing path operations with the result of Git.worktree(), which returns None in a bare repository. Add Git.getcwd() so that callers can ask for the current directory in a consistent way without needing to care about the worktree vs. bare repository distinction. For regular repositories, Git.getcwd() returns the worktree, which allows it to be used in place of Git.worktree(). For bare repositories, Git.getcwd() returns the gitdir. The dual behavior allows callers to easily handle bare repositories. Update callers to use Git.getcwd() in the fsmonitor, main model, and app initialization. Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
Rework the logic so that there's only a single exit point. Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
Git must stop git-directory discovery when it encounters a directory in its list of GIT_CEILING_DIRECTORIES. Teach the git discovery code to honor GIT_CEILING_DIRECTORIES. Add unit tests to cover the new behavior. Signed-off-by: David Aguilar <davvid@gmail.com>
I touched a lot of the core of git.py in this PR so I would appreciate some extra eyes and testers on these changes. @git-cola/developers |
I'll try running from this PR for a few days, and let you know if I notice any problems. |
Thanks for testing @takluyver so far so good, so merging for now as the fix for #548 will build upon these changes. |
davvid
added a commit
that referenced
this pull request
Feb 4, 2016
git: add support for bare repositories and GIT_CEILING_DIRECTORIES Signed-off-by: David Aguilar <davvid@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactor the git module to simplify the code and make it more amenable to testing.
Teach fsmonitor, gitcfg, and app startup to handle bare repositories.
Teach the git discovery code to honor GIT_CEILING_DIRECTORIES.
Add unit tests covering various aspects of repository discovery.
Signed-off-by: David Aguilar davvid@gmail.com