8000 Support building with GopherJS by paralin · Pull Request #360 · go-git/go-git · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Support building with GopherJS #360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ coverage.out
*~
coverage.txt
profile.out
.tmp/
/vendor
/.tmp
1 change: 1 addition & 0 deletions plumbing/format/packfile/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.tmp
26 changes: 26 additions & 0 deletions worktree_gopherjs.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// +build js,!wasm

package git

import (
"syscall"

"github.com/go-git/go-git/v5/plumbing/format/index"
)

func init() {
fillSystemInfo = func(e *index.Entry, sys interface{}) {
if os, ok := sys.(*syscall.Stat_t); ok {
// not supported on gopherjs:
// e.CreatedAt = time.Unix(int64(os.Ctime), int64(os.CtimeNsec))
e.Dev = uint32(os.Dev)
e.Inode = uint32(os.Ino)
e.GID = os.Gid
e.UID = os.Uid
}
}
}

func isSymlinkWindowsNonAdmin(err error) bool {
return false
}
2 changes: 1 addition & 1 deletion worktree_linux.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build linux
// +build linux,!js

package git

Expand Down
2 changes: 1 addition & 1 deletion worktree_js.go → worktree_wasm.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build js
// +build js,wasm

package git

Expand Down
0