Created
August 12, 2019 12:32
-
-
Save mortenholmgaard/80e856227335412d706af3d7bccab955 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def currentBranch() | |
branch = git_branch() | |
if !branch.to_s.empty? | |
return branch | |
end | |
git = Git.open(File.join(File.dirname(__FILE__), '../')) # git_branch() does not seem work on Windows, it will print error with path not found. | |
return git.current_branch | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment