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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
ca685f80
Commit
ca685f80
authored
Aug 11, 2017
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Since now fetch_ref is reliable, we could just rely on it
parent
501be36c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
app/models/repository.rb
app/models/repository.rb
+5
-5
No files found.
app/models/repository.rb
View file @
ca685f80
...
...
@@ -989,12 +989,10 @@ class Repository
if
start_repository
==
self
start_branch_name
else
tmp_ref
=
"refs/tmp/
#{
SecureRandom
.
hex
}
/head"
fetch_ref
(
tmp_ref
=
fetch_ref
(
start_repository
.
path_to_repo
,
"
#{
Gitlab
::
Git
::
BRANCH_REF_PREFIX
}#{
start_branch_name
}
"
,
tmp_ref
"refs/tmp/
#{
SecureRandom
.
hex
}
/head"
)
start_repository
.
commit
(
start_branch_name
).
sha
...
...
@@ -1003,7 +1001,7 @@ class Repository
yield
(
commit
(
branch_name_or_sha
))
ensure
rugged
.
references
.
delete
(
tmp_ref
)
if
tmp_ref
&&
ref_exists?
(
tmp_ref
)
rugged
.
references
.
delete
(
tmp_ref
)
if
tmp_ref
end
def
add_remote
(
name
,
url
)
...
...
@@ -1029,6 +1027,8 @@ class Repository
# Make sure ref was created, and raise Rugged::ReferenceError when not
raise
Rugged
::
ReferenceError
,
message
if
status
!=
0
target_ref
end
def
create_ref
(
ref
,
ref_path
)
...
...
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