Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
3eebca7b
Commit
3eebca7b
authored
Jan 12, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'use-configured-git' into 'master'
Use configured git rather thans system git See merge request !8460
parents
764fc0dd
22a34c81
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
14 deletions
+14
-14
app/models/cycle_analytics/summary.rb
app/models/cycle_analytics/summary.rb
+1
-1
lib/gitlab/git/blame.rb
lib/gitlab/git/blame.rb
+1
-1
lib/gitlab/git/repository.rb
lib/gitlab/git/repository.rb
+3
-3
lib/tasks/gitlab/git.rake
lib/tasks/gitlab/git.rake
+4
-4
spec/support/seed_helper.rb
spec/support/seed_helper.rb
+5
-5
No files found.
app/models/cycle_analytics/summary.rb
View file @
3eebca7b
...
@@ -31,7 +31,7 @@ class CycleAnalytics
...
@@ -31,7 +31,7 @@ class CycleAnalytics
repository
=
@project
.
repository
.
raw_repository
repository
=
@project
.
repository
.
raw_repository
sha
=
@project
.
repository
.
commit
(
ref
).
sha
sha
=
@project
.
repository
.
commit
(
ref
).
sha
cmd
=
%W(
git
--git-dir=
#{
repository
.
path
}
log)
cmd
=
%W(
#{
Gitlab
.
config
.
git
.
bin_path
}
--git-dir=
#{
repository
.
path
}
log)
cmd
<<
'--format=%H'
cmd
<<
'--format=%H'
cmd
<<
"--after=
#{
@from
.
iso8601
}
"
cmd
<<
"--after=
#{
@from
.
iso8601
}
"
cmd
<<
sha
cmd
<<
sha
...
...
lib/gitlab/git/blame.rb
View file @
3eebca7b
...
@@ -27,7 +27,7 @@ module Gitlab
...
@@ -27,7 +27,7 @@ module Gitlab
private
private
def
load_blame
def
load_blame
cmd
=
%W(
git
--git-dir=
#{
@repo
.
path
}
blame -p
#{
@sha
}
--
#{
@path
}
)
cmd
=
%W(
#{
Gitlab
.
config
.
git
.
bin_path
}
--git-dir=
#{
@repo
.
path
}
blame -p
#{
@sha
}
--
#{
@path
}
)
# Read in binary mode to ensure ASCII-8BIT
# Read in binary mode to ensure ASCII-8BIT
raw_output
=
IO
.
popen
(
cmd
,
'rb'
)
{
|
io
|
io
.
read
}
raw_output
=
IO
.
popen
(
cmd
,
'rb'
)
{
|
io
|
io
.
read
}
output
=
encode_utf8
(
raw_output
)
output
=
encode_utf8
(
raw_output
)
...
...
lib/gitlab/git/repository.rb
View file @
3eebca7b
...
@@ -332,7 +332,7 @@ module Gitlab
...
@@ -332,7 +332,7 @@ module Gitlab
end
end
def
log_by_shell
(
sha
,
options
)
def
log_by_shell
(
sha
,
options
)
cmd
=
%W(
git
--git-dir=
#{
path
}
log)
cmd
=
%W(
#{
Gitlab
.
config
.
git
.
bin_path
}
--git-dir=
#{
path
}
log)
cmd
+=
%W(-n
#{
options
[
:limit
].
to_i
}
)
cmd
+=
%W(-n
#{
options
[
:limit
].
to_i
}
)
cmd
+=
%w(--format=%H)
cmd
+=
%w(--format=%H)
cmd
+=
%W(--skip=
#{
options
[
:offset
].
to_i
}
)
cmd
+=
%W(--skip=
#{
options
[
:offset
].
to_i
}
)
...
@@ -913,7 +913,7 @@ module Gitlab
...
@@ -913,7 +913,7 @@ module Gitlab
return
[]
return
[]
end
end
cmd
=
%W(
git
--git-dir=
#{
path
}
ls-tree)
cmd
=
%W(
#{
Gitlab
.
config
.
git
.
bin_path
}
--git-dir=
#{
path
}
ls-tree)
cmd
+=
%w(-r)
cmd
+=
%w(-r)
cmd
+=
%w(--full-tree)
cmd
+=
%w(--full-tree)
cmd
+=
%w(--full-name)
cmd
+=
%w(--full-name)
...
@@ -1108,7 +1108,7 @@ module Gitlab
...
@@ -1108,7 +1108,7 @@ module Gitlab
end
end
def
archive_to_file
(
treeish
=
'master'
,
filename
=
'archive.tar.gz'
,
format
=
nil
,
compress_cmd
=
%w(gzip -n)
)
def
archive_to_file
(
treeish
=
'master'
,
filename
=
'archive.tar.gz'
,
format
=
nil
,
compress_cmd
=
%w(gzip -n)
)
git_archive_cmd
=
%W(
git
--git-dir=
#{
path
}
archive)
git_archive_cmd
=
%W(
#{
Gitlab
.
config
.
git
.
bin_path
}
--git-dir=
#{
path
}
archive)
# Put files into a directory before archiving
# Put files into a directory before archiving
prefix
=
"
#{
archive_name
(
treeish
)
}
/"
prefix
=
"
#{
archive_name
(
treeish
)
}
/"
...
...
lib/tasks/gitlab/git.rake
View file @
3eebca7b
...
@@ -3,7 +3,7 @@ namespace :gitlab do
...
@@ -3,7 +3,7 @@ namespace :gitlab do
desc
"GitLab | Git | Repack"
desc
"GitLab | Git | Repack"
task
repack: :environment
do
task
repack: :environment
do
failures
=
perform_git_cmd
(
%W(
git
repack -a --quiet)
,
"Repacking repo"
)
failures
=
perform_git_cmd
(
%W(
#{
Gitlab
.
config
.
git
.
bin_path
}
repack -a --quiet)
,
"Repacking repo"
)
if
failures
.
empty?
if
failures
.
empty?
puts
"Done"
.
color
(
:green
)
puts
"Done"
.
color
(
:green
)
else
else
...
@@ -13,7 +13,7 @@ namespace :gitlab do
...
@@ -13,7 +13,7 @@ namespace :gitlab do
desc
"GitLab | Git | Run garbage collection on all repos"
desc
"GitLab | Git | Run garbage collection on all repos"
task
gc: :environment
do
task
gc: :environment
do
failures
=
perform_git_cmd
(
%W(
git
gc --auto --quiet)
,
"Garbage Collecting"
)
failures
=
perform_git_cmd
(
%W(
#{
Gitlab
.
config
.
git
.
bin_path
}
gc --auto --quiet)
,
"Garbage Collecting"
)
if
failures
.
empty?
if
failures
.
empty?
puts
"Done"
.
color
(
:green
)
puts
"Done"
.
color
(
:green
)
else
else
...
@@ -23,7 +23,7 @@ namespace :gitlab do
...
@@ -23,7 +23,7 @@ namespace :gitlab do
desc
"GitLab | Git | Prune all repos"
desc
"GitLab | Git | Prune all repos"
task
prune: :environment
do
task
prune: :environment
do
failures
=
perform_git_cmd
(
%W(
git
prune)
,
"Git Prune"
)
failures
=
perform_git_cmd
(
%W(
#{
Gitlab
.
config
.
git
.
bin_path
}
prune)
,
"Git Prune"
)
if
failures
.
empty?
if
failures
.
empty?
puts
"Done"
.
color
(
:green
)
puts
"Done"
.
color
(
:green
)
else
else
...
...
spec/support/seed_helper.rb
View file @
3eebca7b
...
@@ -25,32 +25,32 @@ module SeedHelper
...
@@ -25,32 +25,32 @@ module SeedHelper
end
end
def
create_bare_seeds
def
create_bare_seeds
system
(
git_env
,
*
%W(
git
clone --bare
#{
GITLAB_URL
}
)
,
system
(
git_env
,
*
%W(
#{
Gitlab
.
config
.
git
.
bin_path
}
clone --bare
#{
GITLAB_URL
}
)
,
chdir:
SEED_REPOSITORY_PATH
,
chdir:
SEED_REPOSITORY_PATH
,
out:
'/dev/null'
,
out:
'/dev/null'
,
err:
'/dev/null'
)
err:
'/dev/null'
)
end
end
def
create_normal_seeds
def
create_normal_seeds
system
(
git_env
,
*
%W(
git
clone
#{
TEST_REPO_PATH
}
#{
TEST_NORMAL_REPO_PATH
}
)
,
system
(
git_env
,
*
%W(
#{
Gitlab
.
config
.
git
.
bin_path
}
clone
#{
TEST_REPO_PATH
}
#{
TEST_NORMAL_REPO_PATH
}
)
,
out:
'/dev/null'
,
out:
'/dev/null'
,
err:
'/dev/null'
)
err:
'/dev/null'
)
end
end
def
create_mutable_seeds
def
create_mutable_seeds
system
(
git_env
,
*
%W(
git
clone
#{
TEST_REPO_PATH
}
#{
TEST_MUTABLE_REPO_PATH
}
)
,
system
(
git_env
,
*
%W(
#{
Gitlab
.
config
.
git
.
bin_path
}
clone
#{
TEST_REPO_PATH
}
#{
TEST_MUTABLE_REPO_PATH
}
)
,
out:
'/dev/null'
,
out:
'/dev/null'
,
err:
'/dev/null'
)
err:
'/dev/null'
)
system
(
git_env
,
*
%w(git branch -t feature origin/feature)
,
system
(
git_env
,
*
%w(git branch -t feature origin/feature)
,
chdir:
TEST_MUTABLE_REPO_PATH
,
out:
'/dev/null'
,
err:
'/dev/null'
)
chdir:
TEST_MUTABLE_REPO_PATH
,
out:
'/dev/null'
,
err:
'/dev/null'
)
system
(
git_env
,
*
%W(
git
remote add expendable
#{
GITLAB_URL
}
)
,
system
(
git_env
,
*
%W(
#{
Gitlab
.
config
.
git
.
bin_path
}
remote add expendable
#{
GITLAB_URL
}
)
,
chdir:
TEST_MUTABLE_REPO_PATH
,
out:
'/dev/null'
,
err:
'/dev/null'
)
chdir:
TEST_MUTABLE_REPO_PATH
,
out:
'/dev/null'
,
err:
'/dev/null'
)
end
end
def
create_broken_seeds
def
create_broken_seeds
system
(
git_env
,
*
%W(
git
clone --bare
#{
TEST_REPO_PATH
}
#{
TEST_BROKEN_REPO_PATH
}
)
,
system
(
git_env
,
*
%W(
#{
Gitlab
.
config
.
git
.
bin_path
}
clone --bare
#{
TEST_REPO_PATH
}
#{
TEST_BROKEN_REPO_PATH
}
)
,
out:
'/dev/null'
,
out:
'/dev/null'
,
err:
'/dev/null'
)
err:
'/dev/null'
)
...
...
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