Skip to content

Commit

Permalink
Quote repo names consistently in gh repo sync stdout (cli#9491)
Browse files Browse the repository at this point in the history
* Quote repo names consistently in `gh repo sync` stdout

* Update tests
  • Loading branch information
muzimuzhi authored Aug 21, 2024
1 parent 779a120 commit c81ccab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/cmd/repo/sync/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func syncLocalRepo(opts *SyncOptions) error {

if opts.IO.IsStdoutTTY() {
cs := opts.IO.ColorScheme()
fmt.Fprintf(opts.IO.Out, "%s Synced the \"%s\" branch from %s to local repository\n",
fmt.Fprintf(opts.IO.Out, "%s Synced the \"%s\" branch from \"%s\" to local repository\n",
cs.SuccessIcon(),
opts.Branch,
ghrepo.FullName(srcRepo))
Expand Down
12 changes: 6 additions & 6 deletions pkg/cmd/repo/sync/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func Test_SyncRun(t *testing.T) {
mgc.On("IsDirty").Return(false, nil).Once()
mgc.On("MergeFastForward", "FETCH_HEAD").Return(nil).Once()
},
wantStdout: "✓ Synced the \"trunk\" branch from OWNER/REPO to local repository\n",
wantStdout: "✓ Synced the \"trunk\" branch from \"OWNER/REPO\" to local repository\n",
},
{
name: "sync local repo with parent - notty",
Expand Down Expand Up @@ -162,7 +162,7 @@ func Test_SyncRun(t *testing.T) {
mgc.On("IsDirty").Return(false, nil).Once()
mgc.On("MergeFastForward", "FETCH_HEAD").Return(nil).Once()
},
wantStdout: "✓ Synced the \"trunk\" branch from OWNER2/REPO2 to local repository\n",
wantStdout: "✓ Synced the \"trunk\" branch from \"OWNER2/REPO2\" to local repository\n",
},
{
name: "sync local repo with parent and force specified",
Expand All @@ -179,7 +179,7 @@ func Test_SyncRun(t *testing.T) {
mgc.On("IsDirty").Return(false, nil).Once()
mgc.On("ResetHard", "FETCH_HEAD").Return(nil).Once()
},
wantStdout: "✓ Synced the \"trunk\" branch from OWNER/REPO to local repository\n",
wantStdout: "✓ Synced the \"trunk\" branch from \"OWNER/REPO\" to local repository\n",
},
{
name: "sync local repo with specified source repo and force specified",
Expand All @@ -197,7 +197,7 @@ func Test_SyncRun(t *testing.T) {
mgc.On("IsDirty").Return(false, nil).Once()
mgc.On("ResetHard", "FETCH_HEAD").Return(nil).Once()
},
wantStdout: "✓ Synced the \"trunk\" branch from OWNER2/REPO2 to local repository\n",
wantStdout: "✓ Synced the \"trunk\" branch from \"OWNER2/REPO2\" to local repository\n",
},
{
name: "sync local repo with parent and not fast forward merge",
Expand Down Expand Up @@ -257,7 +257,7 @@ func Test_SyncRun(t *testing.T) {
mgc.On("CurrentBranch").Return("test", nil).Once()
mgc.On("UpdateBranch", "trunk", "FETCH_HEAD").Return(nil).Once()
},
wantStdout: "✓ Synced the \"trunk\" branch from OWNER/REPO to local repository\n",
wantStdout: "✓ Synced the \"trunk\" branch from \"OWNER/REPO\" to local repository\n",
},
{
name: "sync local repo with parent - create new branch",
Expand All @@ -271,7 +271,7 @@ func Test_SyncRun(t *testing.T) {
mgc.On("CurrentBranch").Return("test", nil).Once()
mgc.On("CreateBranch", "trunk", "FETCH_HEAD", "origin/trunk").Return(nil).Once()
},
wantStdout: "✓ Synced the \"trunk\" branch from OWNER/REPO to local repository\n",
wantStdout: "✓ Synced the \"trunk\" branch from \"OWNER/REPO\" to local repository\n",
},
{
name: "sync remote fork with parent with new api - tty",
Expand Down

0 comments on commit c81ccab

Please sign in to comment.