File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ package git
6
6
7
7
// CatFileBlob returns the blob corresponding to the given revision of the repository.
8
8
func (repo * Repository ) CatFileBlob (rev string ) (* Blob , error ) {
9
- revHash , err := r .RevParse (rev , RevParseOptions {Timeout : opt .Timeout }) //nolint
9
+ rev , err := r .RevParse (rev , RevParseOptions {Timeout : opt .Timeout }) //nolint
10
10
if err != nil {
11
11
return nil , err
12
12
}
Original file line number Diff line number Diff line change @@ -17,6 +17,12 @@ func TestRepository_CatFileBlob(t *testing.T) {
17
17
assert .Equal (t , ErrNotBlob , err )
18
18
})
19
19
20
+ t .Run ("get a blob, no full rev hash" , func (t * testing.T ) {
21
+ b , err := testrepo .CatFileBlob ("021a" )
22
+ require .NoError (t , err )
23
+ assert .True (t , b .IsBlob ())
24
+ })
25
+
20
26
t .Run ("get a blob" , func (t * testing.T ) {
21
27
b , err := testrepo .CatFileBlob ("021a721a61a1de65865542c405796d1eb985f784" )
22
28
require .NoError (t , err )
You can’t perform that action at this time.
0 commit comments