diff options
author | Christoph <ckluente@thoughtworks.com> | 2016-07-12 09:00:24 +0200 |
---|---|---|
committer | Christoph <ckluente@thoughtworks.com> | 2016-07-12 09:00:44 +0200 |
commit | 7571e0ecb1ffea65df4498cf002c78c170905df8 (patch) | |
tree | fed513957a73988187a97760f04747cc21e86be2 | |
parent | d1a12ae7aa2660f10046bc7baad688819c61168c (diff) |
add a way to find out if we are dealing with a git subrepo
-rw-r--r-- | lib/leap_cli/util.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/leap_cli/util.rb b/lib/leap_cli/util.rb index 64b5c63..29658da 100644 --- a/lib/leap_cli/util.rb +++ b/lib/leap_cli/util.rb @@ -428,6 +428,15 @@ module LeapCli return $? == 0 end end + + def is_git_subrepo?(dir) + Dir.chdir(dir) do + `ls .gitrepo 2>/dev/null` + return $? == 0 + end + end + + def current_git_branch(dir) Dir.chdir(dir) do |