File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,6 @@ class ReferenceNotFoundException extends \InvalidArgumentException implements Gi
16
16
{
17
17
public function __construct ($ reference )
18
18
{
19
- parent ::__construct (sprintf ('Reference not found ' ));
19
+ parent ::__construct (sprintf ('Reference not found: "%s" ' , $ reference ));
20
20
}
21
21
}
Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ public function resolveTags($hash)
168
168
}
169
169
170
170
$ tags = array ();
171
- foreach ($ this ->references as $ k => $ reference ) {
171
+ foreach ($ this ->references as $ reference ) {
172
172
if ($ reference instanceof Reference \Tag && $ reference ->getCommitHash () === $ hash ) {
173
173
$ tags [] = $ reference ;
174
174
}
@@ -188,14 +188,14 @@ public function resolveBranches($hash)
188
188
$ hash = $ hash ->getHash ();
189
189
}
190
190
191
- $ tags = array ();
192
- foreach ($ this ->references as $ k => $ reference ) {
191
+ $ branches = array ();
192
+ foreach ($ this ->references as $ reference ) {
193
193
if ($ reference instanceof Reference \Branch && $ reference ->getCommitHash () === $ hash ) {
194
- $ tags [] = $ reference ;
194
+ $ branches [] = $ reference ;
195
195
}
196
196
}
197
197
198
- return $ tags ;
198
+ return $ branches ;
199
199
}
200
200
201
201
/**
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ public function testResolve($repository)
89
89
$ resolved = $ repository ->getReferences ()->resolve ($ commit ->getHash ());
90
90
91
91
$ this ->assertEquals (1 , count ($ resolved ), "1 revision resolved " );
92
- $ this ->assertTrue ($ resolved[ 0 ] instanceof Tag, "Resolved object is a tag " );
92
+ $ this ->assertTrue (reset ( $ resolved) instanceof Tag, "Resolved object is a tag " );
93
93
}
94
94
95
95
/**
@@ -101,7 +101,7 @@ public function testResolveTags($repository)
101
101
$ resolved = $ repository ->getReferences ()->resolveTags ($ commit ->getHash ());
102
102
103
103
$ this ->assertEquals (1 , count ($ resolved ), "1 revision resolved " );
104
- $ this ->assertTrue ($ resolved[ 0 ] instanceof Tag, "Resolved object is a tag " );
104
+ $ this ->assertTrue (reset ( $ resolved) instanceof Tag, "Resolved object is a tag " );
105
105
}
106
106
107
107
/**
@@ -114,7 +114,7 @@ public function testResolveBranches($repository)
114
114
$ resolved = $ repository ->getReferences ()->resolveBranches ($ master ->getCommitHash ());
115
115
116
116
$ this ->assertEquals (1 , count ($ resolved ), "1 revision resolved " );
117
- $ this ->assertTrue ($ resolved[ 0 ] instanceof Branch, "Resolved object is a branch " );
117
+ $ this ->assertTrue (reset ( $ resolved) instanceof Branch, "Resolved object is a branch " );
118
118
}
119
119
120
120
/**
You can’t perform that action at this time.
0 commit comments