@@ -44,7 +44,7 @@ func TestGetCommits(t *testing.T) {
4444 opts : GetCommitsOptions {RefName : "HEAD" , RefForPushedStatus : "mybranch" , IncludeRebaseCommits : false },
4545 runner : oscommands .NewFakeRunner (t ).
4646 ExpectGitArgs ([]string {"merge-base" , "mybranch" , "mybranch@{u}" }, "b21997d6b4cbdf84b149d8e6a2c4d06a8e9ec164" , nil ).
47- ExpectGitArgs ([]string {"log" , "HEAD" , "--topo-order" , "--oneline" , "--pretty=format:%H%x00%at%x00%aN%x00%ae%x00%D%x00%p %x00%m%x00%s" , "--abbrev=40" , "--no-show-signature" , "--" }, "" , nil ),
47+ ExpectGitArgs ([]string {"log" , "HEAD" , "--topo-order" , "--oneline" , "--pretty=format:%H%x00%at%x00%aN%x00%ae%x00%D%x00%P %x00%m%x00%s" , "--abbrev=40" , "--no-show-signature" , "--" }, "" , nil ),
4848
4949 expectedCommitOpts : []models.NewCommitOpts {},
5050 expectedError : nil ,
@@ -55,7 +55,7 @@ func TestGetCommits(t *testing.T) {
5555 opts : GetCommitsOptions {RefName : "refs/heads/mybranch" , RefForPushedStatus : "refs/heads/mybranch" , IncludeRebaseCommits : false },
5656 runner : oscommands .NewFakeRunner (t ).
5757 ExpectGitArgs ([]string {"merge-base" , "refs/heads/mybranch" , "mybranch@{u}" }, "b21997d6b4cbdf84b149d8e6a2c4d06a8e9ec164" , nil ).
58- ExpectGitArgs ([]string {"log" , "refs/heads/mybranch" , "--topo-order" , "--oneline" , "--pretty=format:%H%x00%at%x00%aN%x00%ae%x00%D%x00%p %x00%m%x00%s" , "--abbrev=40" , "--no-show-signature" , "--" }, "" , nil ),
58+ ExpectGitArgs ([]string {"log" , "refs/heads/mybranch" , "--topo-order" , "--oneline" , "--pretty=format:%H%x00%at%x00%aN%x00%ae%x00%D%x00%P %x00%m%x00%s" , "--abbrev=40" , "--no-show-signature" , "--" }, "" , nil ),
5959
6060 expectedCommitOpts : []models.NewCommitOpts {},
6161 expectedError : nil ,
@@ -69,7 +69,7 @@ func TestGetCommits(t *testing.T) {
6969 // here it's seeing which commits are yet to be pushed
7070 ExpectGitArgs ([]string {"merge-base" , "mybranch" , "mybranch@{u}" }, "b21997d6b4cbdf84b149d8e6a2c4d06a8e9ec164" , nil ).
7171 // here it's actually getting all the commits in a formatted form, one per line
72- ExpectGitArgs ([]string {"log" , "HEAD" , "--topo-order" , "--oneline" , "--pretty=format:%H%x00%at%x00%aN%x00%ae%x00%D%x00%p %x00%m%x00%s" , "--abbrev=40" , "--no-show-signature" , "--" }, commitsOutput , nil ).
72+ ExpectGitArgs ([]string {"log" , "HEAD" , "--topo-order" , "--oneline" , "--pretty=format:%H%x00%at%x00%aN%x00%ae%x00%D%x00%P %x00%m%x00%s" , "--abbrev=40" , "--no-show-signature" , "--" }, commitsOutput , nil ).
7373 // here it's testing which of the configured main branches have an upstream
7474 ExpectGitArgs ([]string {"rev-parse" , "--symbolic-full-name" , "master@{u}" }, "refs/remotes/origin/master" , nil ). // this one does
7575 ExpectGitArgs ([]string {"rev-parse" , "--symbolic-full-name" , "main@{u}" }, "" , errors .New ("error" )). // this one doesn't, so it checks origin instead
@@ -205,7 +205,7 @@ func TestGetCommits(t *testing.T) {
205205 // here it's seeing which commits are yet to be pushed
206206 ExpectGitArgs ([]string {"merge-base" , "mybranch" , "mybranch@{u}" }, "b21997d6b4cbdf84b149d8e6a2c4d06a8e9ec164" , nil ).
207207 // here it's actually getting all the commits in a formatted form, one per line
208- ExpectGitArgs ([]string {"log" , "HEAD" , "--topo-order" , "--oneline" , "--pretty=format:%H%x00%at%x00%aN%x00%ae%x00%D%x00%p %x00%m%x00%s" , "--abbrev=40" , "--no-show-signature" , "--" }, singleCommitOutput , nil ).
208+ ExpectGitArgs ([]string {"log" , "HEAD" , "--topo-order" , "--oneline" , "--pretty=format:%H%x00%at%x00%aN%x00%ae%x00%D%x00%P %x00%m%x00%s" , "--abbrev=40" , "--no-show-signature" , "--" }, singleCommitOutput , nil ).
209209 // here it's testing which of the configured main branches exist; neither does
210210 ExpectGitArgs ([]string {"rev-parse" , "--symbolic-full-name" , "master@{u}" }, "" , errors .New ("error" )).
211211 ExpectGitArgs ([]string {"rev-parse" , "--verify" , "--quiet" , "refs/remotes/origin/master" }, "" , errors .New ("error" )).
@@ -241,7 +241,7 @@ func TestGetCommits(t *testing.T) {
241241 // here it's seeing which commits are yet to be pushed
242242 ExpectGitArgs ([]string {"merge-base" , "mybranch" , "mybranch@{u}" }, "b21997d6b4cbdf84b149d8e6a2c4d06a8e9ec164" , nil ).
243243 // here it's actually getting all the commits in a formatted form, one per line
244- ExpectGitArgs ([]string {"log" , "HEAD" , "--topo-order" , "--oneline" , "--pretty=format:%H%x00%at%x00%aN%x00%ae%x00%D%x00%p %x00%m%x00%s" , "--abbrev=40" , "--no-show-signature" , "--" }, singleCommitOutput , nil ).
244+ ExpectGitArgs ([]string {"log" , "HEAD" , "--topo-order" , "--oneline" , "--pretty=format:%H%x00%at%x00%aN%x00%ae%x00%D%x00%P %x00%m%x00%s" , "--abbrev=40" , "--no-show-signature" , "--" }, singleCommitOutput , nil ).
245245 // here it's testing which of the configured main branches exist
246246 ExpectGitArgs ([]string {"rev-parse" , "--symbolic-full-name" , "master@{u}" }, "refs/remotes/origin/master" , nil ).
247247 ExpectGitArgs ([]string {"rev-parse" , "--symbolic-full-name" , "main@{u}" }, "" , errors .New ("error" )).
@@ -276,7 +276,7 @@ func TestGetCommits(t *testing.T) {
276276 opts : GetCommitsOptions {RefName : "HEAD" , RefForPushedStatus : "mybranch" , IncludeRebaseCommits : false },
277277 runner : oscommands .NewFakeRunner (t ).
278278 ExpectGitArgs ([]string {"merge-base" , "mybranch" , "mybranch@{u}" }, "b21997d6b4cbdf84b149d8e6a2c4d06a8e9ec164" , nil ).
279- ExpectGitArgs ([]string {"log" , "HEAD" , "--oneline" , "--pretty=format:%H%x00%at%x00%aN%x00%ae%x00%D%x00%p %x00%m%x00%s" , "--abbrev=40" , "--no-show-signature" , "--" }, "" , nil ),
279+ ExpectGitArgs ([]string {"log" , "HEAD" , "--oneline" , "--pretty=format:%H%x00%at%x00%aN%x00%ae%x00%D%x00%P %x00%m%x00%s" , "--abbrev=40" , "--no-show-signature" , "--" }, "" , nil ),
280280
281281 expectedCommitOpts : []models.NewCommitOpts {},
282282 expectedError : nil ,
@@ -287,7 +287,7 @@ func TestGetCommits(t *testing.T) {
287287 opts : GetCommitsOptions {RefName : "HEAD" , RefForPushedStatus : "mybranch" , FilterPath : "src" },
288288 runner : oscommands .NewFakeRunner (t ).
289289 ExpectGitArgs ([]string {"merge-base" , "mybranch" , "mybranch@{u}" }, "b21997d6b4cbdf84b149d8e6a2c4d06a8e9ec164" , nil ).
290- ExpectGitArgs ([]string {"log" , "HEAD" , "--oneline" , "--pretty=format:%H%x00%at%x00%aN%x00%ae%x00%D%x00%p %x00%m%x00%s" , "--abbrev=40" , "--follow" , "--no-show-signature" , "--" , "src" }, "" , nil ),
290+ ExpectGitArgs ([]string {"log" , "HEAD" , "--oneline" , "--pretty=format:%H%x00%at%x00%aN%x00%ae%x00%D%x00%P %x00%m%x00%s" , "--abbrev=40" , "--follow" , "--no-show-signature" , "--" , "src" }, "" , nil ),
291291
292292 expectedCommitOpts : []models.NewCommitOpts {},
293293 expectedError : nil ,
0 commit comments