Skip to content

Commit

Permalink
using rev-parse with ^{commit} instead of new function
Browse files Browse the repository at this point in the history
  • Loading branch information
tirolerstefan committed Feb 27, 2018
1 parent 65df3bb commit c484d29
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
6 changes: 3 additions & 3 deletions lib/braid/command.rb
Expand Up @@ -114,21 +114,21 @@ def determine_repository_revision(mirror)
if mirror.tag
if use_local_cache?
Dir.chdir git_cache.path(mirror.url) do
git.rev_list_1(mirror.local_ref)
git.rev_parse(mirror.local_ref + "^{commit}")
end
else
raise BraidError, 'unable to retrieve tag version when cache disabled.'
end
else
git.rev_list_1(mirror.local_ref)
git.rev_parse(mirror.local_ref + "^{commit}")
end
end

def validate_new_revision(mirror, revision)
if revision.nil?
determine_repository_revision(mirror)
else
new_revision = git.rev_list_1(revision)
new_revision = git.rev_parse(revision + "^{commit}")

if new_revision == mirror.revision
raise InvalidRevision, 'mirror is already at requested revision'
Expand Down
8 changes: 0 additions & 8 deletions lib/braid/operations.rb
Expand Up @@ -223,14 +223,6 @@ def rev_parse(opt)
raise UnknownRevision, opt
end

# git rev-list -1 opt
def rev_list_1(opt)
opt.insert(0, '-1 ')
invoke(:rev_list, opt)
rescue ShellExecutionError
raise UnknownRevision, opt
end

# Implies tracking.
def remote_add(remote, path)
invoke(:remote, 'add', remote, path)
Expand Down

0 comments on commit c484d29

Please sign in to comment.