Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
e401536c
Unverified
Commit
e401536c
authored
Nov 12, 2017
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dockerignore, internal/build: forward correct git folder
parent
cb8bbe70
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
7 deletions
+8
-7
.dockerignore
.dockerignore
+3
-3
env.go
internal/build/env.go
+3
-2
util.go
internal/build/util.go
+2
-2
No files found.
.dockerignore
View file @
e401536c
**/.git
**/.git
/
.git
.git
!
/
.git/HEAD
!.git/HEAD
!
/
.git/refs/heads
!.git/refs/heads
**/*_test.go
**/*_test.go
build/_workspace
build/_workspace
...
...
internal/build/env.go
View file @
e401536c
...
@@ -82,14 +82,15 @@ func Env() Environment {
...
@@ -82,14 +82,15 @@ func Env() Environment {
// LocalEnv returns build environment metadata gathered from git.
// LocalEnv returns build environment metadata gathered from git.
func
LocalEnv
()
Environment
{
func
LocalEnv
()
Environment
{
env
:=
applyEnvFlags
(
Environment
{
Name
:
"local"
,
Repo
:
"ethereum/go-ethereum"
})
env
:=
applyEnvFlags
(
Environment
{
Name
:
"local"
,
Repo
:
"ethereum/go-ethereum"
})
head
:=
ReadGitFile
(
"HEAD"
)
head
:=
readGitFile
(
"HEAD"
)
if
splits
:=
strings
.
Split
(
head
,
" "
);
len
(
splits
)
==
2
{
if
splits
:=
strings
.
Split
(
head
,
" "
);
len
(
splits
)
==
2
{
head
=
splits
[
1
]
head
=
splits
[
1
]
}
else
{
}
else
{
return
env
return
env
}
}
if
env
.
Commit
==
""
{
if
env
.
Commit
==
""
{
env
.
Commit
=
R
eadGitFile
(
head
)
env
.
Commit
=
r
eadGitFile
(
head
)
}
}
if
env
.
Branch
==
""
{
if
env
.
Branch
==
""
{
if
head
!=
"HEAD"
{
if
head
!=
"HEAD"
{
...
...
internal/build/util.go
View file @
e401536c
...
@@ -89,8 +89,8 @@ func RunGit(args ...string) string {
...
@@ -89,8 +89,8 @@ func RunGit(args ...string) string {
return
strings
.
TrimSpace
(
stdout
.
String
())
return
strings
.
TrimSpace
(
stdout
.
String
())
}
}
//
R
eadGitFile returns content of file in .git directory.
//
r
eadGitFile returns content of file in .git directory.
func
R
eadGitFile
(
file
string
)
string
{
func
r
eadGitFile
(
file
string
)
string
{
content
,
err
:=
ioutil
.
ReadFile
(
path
.
Join
(
".git"
,
file
))
content
,
err
:=
ioutil
.
ReadFile
(
path
.
Join
(
".git"
,
file
))
if
err
!=
nil
{
if
err
!=
nil
{
return
""
return
""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment