File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ describe GitVersion do
30
30
hash = git.current_commit_hash
31
31
hashWithoutPrefix = git.current_commit_hash_without_prefix
32
32
33
- hash.should eq(" sha#{ hashWithoutPrefix } " )
33
+ hash.should eq(" sha. #{ hashWithoutPrefix } " )
34
34
end
35
35
end
36
36
it " should get the correct version in master and dev branch" do
Original file line number Diff line number Diff line change @@ -74,13 +74,13 @@ module GitVersion
74
74
75
75
def current_commit_hash : String
76
76
cmd = " git rev-parse --verify HEAD --short"
77
- sha = (exec cmd)[0 ].rjust( 7 , '0' )
78
- return " sha" + sha
77
+ sha = (exec cmd)[0 ].strip
78
+ return " sha. " + sha
79
79
end
80
80
81
81
def current_commit_hash_without_prefix : String
82
82
cmd = " git rev-parse --verify HEAD --short"
83
- return (exec cmd)[0 ].rjust( 7 , '0' )
83
+ sha = (exec cmd)[0 ].strip
84
84
end
85
85
86
86
def commits_distance (tag : String | Nil )
You can’t perform that action at this time.
0 commit comments