gitvers 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gitvers/repository.rb +7 -2
- data/lib/gitvers/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44bf054e60011e1929bff58edad3db900e2ad026
|
4
|
+
data.tar.gz: f37543a43344a6ca41c39baeb9d8f54f9f73eea9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3edee606480d87c07372b1fd944891c74fca921c660bc1c91a6de9a9ee7ddd2e05b53dff737975e5736fb94774a339d85825737ad41660d9ad82f305c48cb8cc
|
7
|
+
data.tar.gz: 0c775b080e44dda95bbaadcf7784c8ecde2adf1bd8be6ab16a64caf658bed10575c93fd4e439280f86568b8b0551036fe53f5402f053fa471873d84f6ca09638
|
data/lib/gitvers/repository.rb
CHANGED
@@ -13,9 +13,14 @@ module Gitvers
|
|
13
13
|
while path != '/'
|
14
14
|
git_dir = File.join(path, "/.git")
|
15
15
|
head_file = File.join(path, "/HEAD")
|
16
|
+
if File.exist?(git_dir)
|
17
|
+
@git_dir = git_dir
|
18
|
+
break
|
19
|
+
elsif File.exists?(head_file)
|
20
|
+
@git_dir = path
|
21
|
+
break
|
22
|
+
end
|
16
23
|
path = File.expand_path(File.join(path, '..'))
|
17
|
-
next unless File.exist?(git_dir) || File.exists?(head_file)
|
18
|
-
@git_dir = git_dir
|
19
24
|
end
|
20
25
|
@git_dir or raise "Invalid git repository #{@path}"
|
21
26
|
end
|
data/lib/gitvers/version.rb
CHANGED