projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '14874-protected-collection-properties'
[arvados.git]
/
services
/
api
/
app
/
models
/
commit.rb
diff --git
a/services/api/app/models/commit.rb
b/services/api/app/models/commit.rb
index b0efbc7cb0c2c84c5ed4fb705b1e7dc5e88b5138..2f7e9cd9345ff347c9f5bee05abe58a113dd267b 100644
(file)
--- a/
services/api/app/models/commit.rb
+++ b/
services/api/app/models/commit.rb
@@
-2,10
+2,12
@@
#
# SPDX-License-Identifier: AGPL-3.0
#
# SPDX-License-Identifier: AGPL-3.0
+require 'request_error'
+
class Commit < ActiveRecord::Base
extend CurrentApiClient
class Commit < ActiveRecord::Base
extend CurrentApiClient
- class GitError <
Standard
Error
+ class GitError <
Request
Error
def http_status
422
end
def http_status
422
end
@@
-146,7
+148,7
@@
class Commit < ActiveRecord::Base
unless src_gitdir
raise ArgumentError.new "no local repository for #{repo_name}"
end
unless src_gitdir
raise ArgumentError.new "no local repository for #{repo_name}"
end
- dst_gitdir = Rails.configuration.
git_internal_d
ir
+ dst_gitdir = Rails.configuration.
Containers.JobsAPI.GitInternalD
ir
begin
commit_in_dst = must_git(dst_gitdir, "log -n1 --format=%H #{sha1.shellescape}^{commit}").strip
begin
commit_in_dst = must_git(dst_gitdir, "log -n1 --format=%H #{sha1.shellescape}^{commit}").strip
@@
-219,7
+221,7
@@
class Commit < ActiveRecord::Base
end
def self.cache_dir_base
end
def self.cache_dir_base
- Rails.root.join 'tmp', 'git'
+ Rails.root.join 'tmp', 'git
-cache
'
end
def self.fetch_remote_repository gitdir, git_url
end
def self.fetch_remote_repository gitdir, git_url
@@
-233,7
+235,7
@@
class Commit < ActiveRecord::Base
begin
must_git gitdir, "branch"
rescue GitError => e
begin
must_git gitdir, "branch"
rescue GitError => e
- raise unless /Not a git repository/ =~ e.to_s
+ raise unless /Not a git repository/
i
=~ e.to_s
# OK, this just means we need to create a blank cache repository
# before fetching.
FileUtils.mkdir_p gitdir
# OK, this just means we need to create a blank cache repository
# before fetching.
FileUtils.mkdir_p gitdir