Skip to content
This repository has been archived by the owner on Dec 24, 2019. It is now read-only.

Commit

Permalink
Fix references to refspec that should be ref
Browse files Browse the repository at this point in the history
  • Loading branch information
richo authored and benhoskings committed Oct 2, 2012
1 parent 17f2479 commit 1284826
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions lib/babushka/git_repo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@ def current_full_head
repo_shell("git rev-parse HEAD")
end

# The short SHA of the commit that +refspec+ currently refers to.
def resolve refspec
repo_shell?("git rev-parse --short #{refspec}")
# The short SHA of the commit that +ref+ currently refers to.
def resolve ref
repo_shell?("git rev-parse --short #{ref}")
end

# The remote assigned to branch in the git config, or 'origin' if none
Expand Down Expand Up @@ -252,22 +252,22 @@ def track! branch
repo_shell("git checkout -t '#{branch}' -b '#{branch.sub(/^.*\//, '')}'")
end

# Check out the supplied refspec, detaching the HEAD if the named ref
# Check out the supplied ref, detaching the HEAD if the named ref
# isn't a branch.
def checkout! refspec
repo_shell("git checkout '#{refspec}'")
def checkout! ref
repo_shell("git checkout '#{ref}'")
end

# Check out the supplied refspec, detaching the HEAD (if the installed git
# Check out the supplied ref, detaching the HEAD (if the installed git
# version supports doing that).
def detach! refspec
repo_shell("git checkout '#{resolve(refspec)}'")
def detach! ref
repo_shell("git checkout '#{resolve(ref)}'")
end

# Reset the repo to the given ref, discarding changes in the index and
# working copy.
def reset_hard! refspec = 'HEAD'
repo_shell("git reset --hard #{refspec}")
def reset_hard! ref = 'HEAD'
repo_shell("git reset --hard #{ref}")
end

def inspect
Expand Down

0 comments on commit 1284826

Please sign in to comment.