Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
github
hub
提交
498789a9
H
hub
项目概览
github
/
hub
10 个月 前同步成功
通知
3
Star
22523
Fork
2406
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hub
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
498789a9
编写于
2月 10, 2014
作者:
J
Jingwen Owen Ou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Change namespace to github/hub
上级
b9703e61
变更
46
隐藏空白更改
内联
并排
Showing
46 changed file
with
90 addition
and
88 deletion
+90
-88
Godeps/Godeps.json
Godeps/Godeps.json
+4
-4
Godeps/_workspace/src/github.com/jingweno/go-octokit/octokit/client.go
...pace/src/github.com/jingweno/go-octokit/octokit/client.go
+3
-9
Godeps/_workspace/src/github.com/jingweno/go-octokit/octokit/uploads.go
...ace/src/github.com/jingweno/go-octokit/octokit/uploads.go
+3
-3
Godeps/_workspace/src/github.com/jingweno/go-octokit/octokit/uploads_test.go
...rc/github.com/jingweno/go-octokit/octokit/uploads_test.go
+1
-1
cmd/cmd.go
cmd/cmd.go
+1
-1
commands/alias.go
commands/alias.go
+1
-1
commands/args.go
commands/args.go
+1
-1
commands/browse.go
commands/browse.go
+2
-2
commands/checkout.go
commands/checkout.go
+2
-2
commands/cherry_pick.go
commands/cherry_pick.go
+2
-2
commands/ci_status.go
commands/ci_status.go
+3
-3
commands/clone.go
commands/clone.go
+1
-1
commands/clone_test.go
commands/clone_test.go
+1
-1
commands/compare.go
commands/compare.go
+2
-2
commands/create.go
commands/create.go
+3
-3
commands/fetch.go
commands/fetch.go
+2
-2
commands/fork.go
commands/fork.go
+2
-2
commands/init.go
commands/init.go
+2
-2
commands/init_test.go
commands/init_test.go
+1
-1
commands/issue.go
commands/issue.go
+3
-2
commands/merge.go
commands/merge.go
+2
-2
commands/pull_request.go
commands/pull_request.go
+3
-3
commands/pull_request_test.go
commands/pull_request_test.go
+1
-1
commands/push.go
commands/push.go
+2
-2
commands/release.go
commands/release.go
+2
-2
commands/remote.go
commands/remote.go
+2
-2
commands/remote_test.go
commands/remote_test.go
+1
-1
commands/runner.go
commands/runner.go
+3
-3
commands/submodule_test.go
commands/submodule_test.go
+1
-1
commands/update.go
commands/update.go
+1
-1
commands/updater.go
commands/updater.go
+3
-3
commands/updater_test.go
commands/updater_test.go
+1
-1
commands/utils.go
commands/utils.go
+2
-2
commands/version.go
commands/version.go
+2
-2
git/git.go
git/git.go
+2
-1
github/branch.go
github/branch.go
+1
-1
github/client.go
github/client.go
+8
-2
github/configs.go
github/configs.go
+1
-1
github/crash_report.go
github/crash_report.go
+2
-2
github/crash_report_test.go
github/crash_report_test.go
+1
-1
github/editor.go
github/editor.go
+2
-2
github/hosts.go
github/hosts.go
+1
-1
github/localrepo.go
github/localrepo.go
+1
-1
github/project.go
github/project.go
+2
-2
github/remote.go
github/remote.go
+1
-1
main.go
main.go
+2
-2
未找到文件。
Godeps/Godeps.json
浏览文件 @
498789a9
{
"ImportPath"
:
"github.com/
jingweno/gh
"
,
"ImportPath"
:
"github.com/
github/hub
"
,
"GoVersion"
:
"go1.2"
,
"Packages"
:
[
"./..."
...
...
@@ -35,8 +35,8 @@
},
{
"ImportPath"
:
"github.com/jingweno/go-octokit/octokit"
,
"Comment"
:
"v0.4.0-4
6-g30737c
b"
,
"Rev"
:
"
30737cb1e9207e1a7633e3d7539951c5c3d93058
"
"Comment"
:
"v0.4.0-4
9-gc08264
b"
,
"Rev"
:
"
c08264b452c4a2960650be6bf0e33408c62c9bf1
"
},
{
"ImportPath"
:
"github.com/jtacoma/uritemplates"
,
...
...
@@ -61,7 +61,7 @@
"Rev"
:
"cb3f837f5ac26e080a9002dcb4d2e8472e623916"
},
{
"ImportPath"
:
"
https://
github.com/ogier/pflag"
,
"ImportPath"
:
"github.com/ogier/pflag"
,
"Rev"
:
"fc2d9a0ef658fa4e4c319939fd6f4b6becfccb48"
}
]
...
...
Godeps/_workspace/src/github.com/jingweno/go-octokit/octokit/client.go
浏览文件 @
498789a9
...
...
@@ -3,9 +3,9 @@ package octokit
import
(
"github.com/lostisland/go-sawyer"
"github.com/lostisland/go-sawyer/hypermedia"
"io"
"net/http"
"net/url"
"os"
)
func
NewClient
(
authMethod
AuthMethod
)
*
Client
{
...
...
@@ -70,21 +70,15 @@ func (c *Client) patch(url *url.URL, input interface{}, output interface{}) (res
})
}
func
(
c
*
Client
)
upload
(
uploadUrl
*
url
.
URL
,
asset
*
os
.
File
,
contentType
string
)
(
result
*
Result
)
{
func
(
c
*
Client
)
upload
(
uploadUrl
*
url
.
URL
,
asset
io
.
ReadCloser
,
contentType
string
,
contentLength
int64
)
(
result
*
Result
)
{
req
,
err
:=
c
.
newSawyerRequest
(
uploadUrl
.
String
())
if
err
!=
nil
{
result
=
newResult
(
nil
,
err
)
return
}
fi
,
err
:=
asset
.
Stat
()
if
err
!=
nil
{
result
=
newResult
(
nil
,
err
)
return
}
req
.
Header
.
Add
(
"Content-Type"
,
contentType
)
req
.
ContentLength
=
fi
.
Size
()
req
.
ContentLength
=
contentLength
req
.
Body
=
asset
sawyerResp
:=
req
.
Post
()
...
...
Godeps/_workspace/src/github.com/jingweno/go-octokit/octokit/uploads.go
浏览文件 @
498789a9
package
octokit
import
(
"io"
"net/url"
"os"
)
// Create an UploadsService with the base url.URL
...
...
@@ -15,6 +15,6 @@ type UploadsService struct {
URL
*
url
.
URL
}
func
(
u
*
UploadsService
)
UploadAsset
(
asset
*
os
.
File
,
contentType
string
)
(
result
*
Result
)
{
return
u
.
client
.
upload
(
u
.
URL
,
asset
,
contentType
)
func
(
u
*
UploadsService
)
UploadAsset
(
asset
io
.
ReadCloser
,
contentType
string
,
contentLength
int64
)
(
result
*
Result
)
{
return
u
.
client
.
upload
(
u
.
URL
,
asset
,
contentType
,
contentLength
)
}
Godeps/_workspace/src/github.com/jingweno/go-octokit/octokit/uploads_test.go
浏览文件 @
498789a9
...
...
@@ -33,7 +33,7 @@ func TestUploadsService_UploadAsset(t *testing.T) {
assert
.
Equal
(
t
,
nil
,
err
)
open
,
_
:=
os
.
Open
(
file
.
Name
())
result
:=
client
.
Uploads
(
url
)
.
UploadAsset
(
open
,
"text/plain"
)
result
:=
client
.
Uploads
(
url
)
.
UploadAsset
(
open
,
"text/plain"
,
fi
.
Size
()
)
fmt
.
Println
(
result
)
assert
.
T
(
t
,
!
result
.
HasError
())
...
...
cmd/cmd.go
浏览文件 @
498789a9
...
...
@@ -2,7 +2,7 @@ package cmd
import
(
"fmt"
"github.com/
jingweno/gh
/utils"
"github.com/
github/hub
/utils"
"github.com/kballard/go-shellquote"
"os"
"os/exec"
...
...
commands/alias.go
浏览文件 @
498789a9
...
...
@@ -2,7 +2,7 @@ package commands
import
(
"fmt"
"github.com/
jingweno/gh
/utils"
"github.com/
github/hub
/utils"
"os"
"path/filepath"
"strings"
...
...
commands/args.go
浏览文件 @
498789a9
...
...
@@ -2,7 +2,7 @@ package commands
import
(
"fmt"
"github.com/
jingweno/gh
/cmd"
"github.com/
github/hub
/cmd"
"strings"
)
...
...
commands/browse.go
浏览文件 @
498789a9
...
...
@@ -2,8 +2,8 @@ package commands
import
(
"fmt"
"github.com/
jingweno/gh
/github"
"github.com/
jingweno/gh
/utils"
"github.com/
github/hub
/github"
"github.com/
github/hub
/utils"
"net/url"
"reflect"
"strings"
...
...
commands/checkout.go
浏览文件 @
498789a9
...
...
@@ -2,8 +2,8 @@ package commands
import
(
"fmt"
"github.com/
jingweno/gh
/github"
"github.com/
jingweno/gh
/utils"
"github.com/
github/hub
/github"
"github.com/
github/hub
/utils"
"regexp"
)
...
...
commands/cherry_pick.go
浏览文件 @
498789a9
package
commands
import
(
"github.com/
jingweno/gh
/github"
"github.com/
jingweno/gh
/utils"
"github.com/
github/hub
/github"
"github.com/
github/hub
/utils"
"regexp"
)
...
...
commands/ci_status.go
浏览文件 @
498789a9
...
...
@@ -2,9 +2,9 @@ package commands
import
(
"fmt"
"github.com/
jingweno/gh
/git"
"github.com/
jingweno/gh
/github"
"github.com/
jingweno/gh
/utils"
"github.com/
github/hub
/git"
"github.com/
github/hub
/github"
"github.com/
github/hub
/utils"
"os"
)
...
...
commands/clone.go
浏览文件 @
498789a9
package
commands
import
(
"github.com/
jingweno/gh
/github"
"github.com/
github/hub
/github"
"regexp"
"strings"
)
...
...
commands/clone_test.go
浏览文件 @
498789a9
...
...
@@ -2,7 +2,7 @@ package commands
import
(
"github.com/bmizerany/assert"
"github.com/
jingweno/gh
/github"
"github.com/
github/hub
/github"
"os"
"testing"
)
...
...
commands/compare.go
浏览文件 @
498789a9
...
...
@@ -5,8 +5,8 @@ import (
"regexp"
"strings"
"github.com/
jingweno/gh
/github"
"github.com/
jingweno/gh
/utils"
"github.com/
github/hub
/github"
"github.com/
github/hub
/utils"
)
var
cmdCompare
=
&
Command
{
...
...
commands/create.go
浏览文件 @
498789a9
...
...
@@ -2,9 +2,9 @@ package commands
import
(
"fmt"
"github.com/
jingweno/gh
/git"
"github.com/
jingweno/gh
/github"
"github.com/
jingweno/gh
/utils"
"github.com/
github/hub
/git"
"github.com/
github/hub
/github"
"github.com/
github/hub
/utils"
"regexp"
"strings"
)
...
...
commands/fetch.go
浏览文件 @
498789a9
package
commands
import
(
"github.com/
jingweno/gh
/github"
"github.com/
jingweno/gh
/utils"
"github.com/
github/hub
/github"
"github.com/
github/hub
/utils"
"regexp"
"strings"
)
...
...
commands/fork.go
浏览文件 @
498789a9
...
...
@@ -2,8 +2,8 @@ package commands
import
(
"fmt"
"github.com/
jingweno/gh
/github"
"github.com/
jingweno/gh
/utils"
"github.com/
github/hub
/github"
"github.com/
github/hub
/utils"
"os"
"reflect"
)
...
...
commands/init.go
浏览文件 @
498789a9
package
commands
import
(
"github.com/
jingweno/gh
/github"
"github.com/
jingweno/gh
/utils"
"github.com/
github/hub
/github"
"github.com/
github/hub
/utils"
)
var
cmdInit
=
&
Command
{
...
...
commands/init_test.go
浏览文件 @
498789a9
...
...
@@ -2,7 +2,7 @@ package commands
import
(
"github.com/bmizerany/assert"
"github.com/
jingweno/gh
/github"
"github.com/
github/hub
/github"
"os"
"regexp"
"testing"
...
...
commands/issue.go
浏览文件 @
498789a9
...
...
@@ -2,8 +2,9 @@ package commands
import
(
"fmt"
"github.com/jingweno/gh/github"
"github.com/jingweno/gh/utils"
"github.com/github/hub/github"
"github.com/github/hub/utils"
)
var
(
...
...
commands/merge.go
浏览文件 @
498789a9
...
...
@@ -2,8 +2,8 @@ package commands
import
(
"fmt"
"github.com/
jingweno/gh
/github"
"github.com/
jingweno/gh
/utils"
"github.com/
github/hub
/github"
"github.com/
github/hub
/utils"
"regexp"
)
...
...
commands/pull_request.go
浏览文件 @
498789a9
...
...
@@ -2,9 +2,9 @@ package commands
import
(
"fmt"
"github.com/
jingweno/gh
/git"
"github.com/
jingweno/gh
/github"
"github.com/
jingweno/gh
/utils"
"github.com/
github/hub
/git"
"github.com/
github/hub
/github"
"github.com/
github/hub
/utils"
"reflect"
"regexp"
"strings"
...
...
commands/pull_request_test.go
浏览文件 @
498789a9
...
...
@@ -2,7 +2,7 @@ package commands
import
(
"github.com/bmizerany/assert"
"github.com/
jingweno/gh
/github"
"github.com/
github/hub
/github"
"testing"
)
...
...
commands/push.go
浏览文件 @
498789a9
package
commands
import
(
"github.com/
jingweno/gh
/github"
"github.com/
jingweno/gh
/utils"
"github.com/
github/hub
/github"
"github.com/
github/hub
/utils"
"strings"
)
...
...
commands/release.go
浏览文件 @
498789a9
...
...
@@ -3,8 +3,8 @@ package commands
import
(
"bytes"
"fmt"
"github.com/
jingweno/gh
/github"
"github.com/
jingweno/gh
/utils"
"github.com/
github/hub
/github"
"github.com/
github/hub
/utils"
"github.com/jingweno/go-octokit/octokit"
"io"
"net/http"
...
...
commands/remote.go
浏览文件 @
498789a9
...
...
@@ -2,8 +2,8 @@ package commands
import
(
"fmt"
"github.com/
jingweno/gh
/github"
"github.com/
jingweno/gh
/utils"
"github.com/
github/hub
/github"
"github.com/
github/hub
/utils"
"regexp"
)
...
...
commands/remote_test.go
浏览文件 @
498789a9
...
...
@@ -2,7 +2,7 @@ package commands
import
(
"github.com/bmizerany/assert"
"github.com/
jingweno/gh
/github"
"github.com/
github/hub
/github"
"os"
"regexp"
"testing"
...
...
commands/runner.go
浏览文件 @
498789a9
...
...
@@ -2,9 +2,9 @@ package commands
import
(
"fmt"
"github.com/
jingweno/gh
/cmd"
"github.com/
jingweno/gh
/git"
"github.com/
jingweno/gh
/utils"
"github.com/
github/hub
/cmd"
"github.com/
github/hub
/git"
"github.com/
github/hub
/utils"
"github.com/kballard/go-shellquote"
flag
"github.com/ogier/pflag"
"os"
...
...
commands/submodule_test.go
浏览文件 @
498789a9
...
...
@@ -2,7 +2,7 @@ package commands
import
(
"github.com/bmizerany/assert"
"github.com/
jingweno/gh
/github"
"github.com/
github/hub
/github"
"testing"
)
...
...
commands/update.go
浏览文件 @
498789a9
package
commands
import
(
"github.com/
jingweno/gh
/utils"
"github.com/
github/hub
/utils"
"os"
)
...
...
commands/updater.go
浏览文件 @
498789a9
...
...
@@ -3,10 +3,10 @@ package commands
import
(
"archive/zip"
"fmt"
"github.com/github/hub/git"
"github.com/github/hub/github"
"github.com/github/hub/utils"
goupdate
"github.com/inconshreveable/go-update"
"github.com/jingweno/gh/git"
"github.com/jingweno/gh/github"
"github.com/jingweno/gh/utils"
"io"
"io/ioutil"
"math/rand"
...
...
commands/updater_test.go
浏览文件 @
498789a9
...
...
@@ -3,7 +3,7 @@ package commands
import
(
"fmt"
"github.com/bmizerany/assert"
"github.com/
jingweno/gh
/git"
"github.com/
github/hub
/git"
"io"
"io/ioutil"
"net/http"
...
...
commands/utils.go
浏览文件 @
498789a9
package
commands
import
(
"github.com/
jingweno/gh
/github"
"github.com/
jingweno/gh
/utils"
"github.com/
github/hub
/github"
"github.com/
github/hub
/utils"
"github.com/jingweno/go-octokit/octokit"
"io/ioutil"
"os"
...
...
commands/version.go
浏览文件 @
498789a9
...
...
@@ -2,8 +2,8 @@ package commands
import
(
"fmt"
"github.com/
jingweno/gh
/git"
"github.com/
jingweno/gh
/utils"
"github.com/
github/hub
/git"
"github.com/
github/hub
/utils"
"os"
)
...
...
git/git.go
浏览文件 @
498789a9
...
...
@@ -2,11 +2,12 @@ package git
import
(
"fmt"
"github.com/jingweno/gh/cmd"
"io/ioutil"
"os"
"path/filepath"
"strings"
"github.com/github/hub/cmd"
)
func
Version
()
(
string
,
error
)
{
...
...
github/branch.go
浏览文件 @
498789a9
...
...
@@ -2,7 +2,7 @@ package github
import
(
"fmt"
"github.com/
jingweno/gh
/git"
"github.com/
github/hub
/git"
"regexp"
"strings"
)
...
...
github/client.go
浏览文件 @
498789a9
...
...
@@ -2,11 +2,12 @@ package github
import
(
"fmt"
"github.com/jingweno/go-octokit/octokit"
"net/http"
"net/url"
"os"
"strings"
"github.com/jingweno/go-octokit/octokit"
)
const
(
...
...
@@ -157,7 +158,12 @@ func (client *Client) CreateRelease(project *Project, params octokit.ReleasePara
func
(
client
*
Client
)
UploadReleaseAsset
(
uploadUrl
*
url
.
URL
,
asset
*
os
.
File
,
contentType
string
)
(
err
error
)
{
c
:=
client
.
octokit
()
result
:=
c
.
Uploads
(
uploadUrl
)
.
UploadAsset
(
asset
,
contentType
)
fileInfo
,
err
:=
asset
.
Stat
()
if
err
!=
nil
{
return
}
result
:=
c
.
Uploads
(
uploadUrl
)
.
UploadAsset
(
asset
,
contentType
,
fileInfo
.
Size
())
if
result
.
HasError
()
{
err
=
fmt
.
Errorf
(
"Error uploading asset: %s"
,
result
.
Err
)
}
...
...
github/configs.go
浏览文件 @
498789a9
...
...
@@ -3,8 +3,8 @@ package github
import
(
"encoding/json"
"fmt"
"github.com/github/hub/utils"
"github.com/howeyc/gopass"
"github.com/jingweno/gh/utils"
"io"
"io/ioutil"
"os"
...
...
github/crash_report.go
浏览文件 @
498789a9
...
...
@@ -4,8 +4,8 @@ import (
"bytes"
"errors"
"fmt"
"github.com/
jingweno/gh
/git"
"github.com/
jingweno/gh
/utils"
"github.com/
github/hub
/git"
"github.com/
github/hub
/utils"
"os"
"reflect"
"runtime"
...
...
github/crash_report_test.go
浏览文件 @
498789a9
...
...
@@ -2,7 +2,7 @@ package github
import
(
"github.com/bmizerany/assert"
"github.com/
jingweno/gh
/git"
"github.com/
github/hub
/git"
"testing"
)
...
...
github/editor.go
浏览文件 @
498789a9
...
...
@@ -11,8 +11,8 @@ import (
"regexp"
"strings"
"github.com/
jingweno/gh
/cmd"
"github.com/
jingweno/gh
/git"
"github.com/
github/hub
/cmd"
"github.com/
github/hub
/git"
)
func
NewEditor
(
topic
,
message
string
)
(
editor
*
Editor
,
err
error
)
{
...
...
github/hosts.go
浏览文件 @
498789a9
...
...
@@ -2,7 +2,7 @@ package github
import
(
"fmt"
"github.com/
jingweno/gh
/git"
"github.com/
github/hub
/git"
"os"
"strings"
)
...
...
github/localrepo.go
浏览文件 @
498789a9
...
...
@@ -2,7 +2,7 @@ package github
import
(
"fmt"
"github.com/
jingweno/gh
/git"
"github.com/
github/hub
/git"
)
func
LocalRepo
()
*
GitHubRepo
{
...
...
github/project.go
浏览文件 @
498789a9
...
...
@@ -3,8 +3,8 @@ package github
import
(
"errors"
"fmt"
"github.com/
jingweno/gh
/git"
"github.com/
jingweno/gh
/utils"
"github.com/
github/hub
/git"
"github.com/
github/hub
/utils"
"net/url"
"os"
"regexp"
...
...
github/remote.go
浏览文件 @
498789a9
...
...
@@ -2,7 +2,7 @@ package github
import
(
"fmt"
"github.com/
jingweno/gh
/git"
"github.com/
github/hub
/git"
"net/url"
"regexp"
"strings"
...
...
main.go
浏览文件 @
498789a9
package
main
import
(
"github.com/
jingweno/gh
/commands"
"github.com/
jingweno/gh
/github"
"github.com/
github/hub
/commands"
"github.com/
github/hub
/github"
"os"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录