Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
brew
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KMSCAKKSCFKA AKFACAMADCAS
brew
Commits
68bbe6ee
Commit
68bbe6ee
authored
8 years ago
by
Martin Afanasjew
Browse files
Options
Downloads
Patches
Plain Diff
Use GitRepositoryExtension for 'path' in Tap
Closes #464. Signed-off-by:
Martin Afanasjew
<
martin@afanasjew.de
>
parent
77dd9d56
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Library/Homebrew/tap.rb
+8
-18
8 additions, 18 deletions
Library/Homebrew/tap.rb
with
8 additions
and
18 deletions
Library/Homebrew/tap.rb
+
8
−
18
View file @
68bbe6ee
...
...
@@ -62,6 +62,7 @@ class Tap
@repo
=
repo
@name
=
"
#{
@user
}
/
#{
@repo
}
"
.
downcase
@path
=
TAP_DIRECTORY
/
"
#{
@user
}
/homebrew-
#{
@repo
}
"
.
downcase
@path
.
extend
(
GitRepositoryExtension
)
end
# clear internal cache
...
...
@@ -84,15 +85,8 @@ class Tap
# The remote path to this {Tap}.
# e.g. `https://github.com/user/homebrew-repo`
def
remote
@remote
||=
if
installed?
if
git?
&&
Utils
.
git_available?
path
.
cd
do
Utils
.
popen_read
(
"git"
,
"config"
,
"--get"
,
"remote.origin.url"
).
chomp
end
end
else
raise
TapUnavailableError
,
name
end
raise
TapUnavailableError
,
name
unless
installed?
@remote
||=
path
.
git_origin
end
# The default remote path to this {Tap}.
...
...
@@ -102,35 +96,31 @@ class Tap
# True if this {Tap} is a git repository.
def
git?
(
path
/
"
.git
"
).
exist
?
path
.
git?
end
# git HEAD for this {Tap}.
def
git_head
raise
TapUnavailableError
,
name
unless
installed?
return
unless
git?
&&
Utils
.
git_available?
path
.
cd
{
Utils
.
popen_read
(
"git"
,
"rev-parse"
,
"--verify"
,
"-q"
,
"HEAD"
).
chuzzle
}
path
.
git_head
end
# git HEAD in short format for this {Tap}.
def
git_short_head
raise
TapUnavailableError
,
name
unless
installed?
return
unless
git?
&&
Utils
.
git_available?
path
.
cd
{
Utils
.
popen_read
(
"git"
,
"rev-parse"
,
"--short=4"
,
"--verify"
,
"-q"
,
"HEAD"
).
chuzzle
}
path
.
git_short_head
end
# time since git last commit for this {Tap}.
def
git_last_commit
raise
TapUnavailableError
,
name
unless
installed?
return
unless
git?
&&
Utils
.
git_available?
path
.
cd
{
Utils
.
popen_read
(
"git"
,
"show"
,
"-s"
,
"--format=%cr"
,
"HEAD"
).
chuzzle
}
path
.
git_last_commit
end
# git last commit date for this {Tap}.
def
git_last_commit_date
raise
TapUnavailableError
,
name
unless
installed?
return
unless
git?
&&
Utils
.
git_available?
path
.
cd
{
Utils
.
popen_read
(
"git"
,
"show"
,
"-s"
,
"--format=%cd"
,
"--date=short"
,
"HEAD"
).
chuzzle
}
path
.
git_last_commit_date
end
# The issues URL of this {Tap}.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment