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
No related tags found
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
...
@@ -62,6 +62,7 @@ class Tap
@repo
=
repo
@repo
=
repo
@name
=
"
#{
@user
}
/
#{
@repo
}
"
.
downcase
@name
=
"
#{
@user
}
/
#{
@repo
}
"
.
downcase
@path
=
TAP_DIRECTORY
/
"
#{
@user
}
/homebrew-
#{
@repo
}
"
.
downcase
@path
=
TAP_DIRECTORY
/
"
#{
@user
}
/homebrew-
#{
@repo
}
"
.
downcase
@path
.
extend
(
GitRepositoryExtension
)
end
end
# clear internal cache
# clear internal cache
...
@@ -84,15 +85,8 @@ class Tap
...
@@ -84,15 +85,8 @@ class Tap
# The remote path to this {Tap}.
# The remote path to this {Tap}.
# e.g. `https://github.com/user/homebrew-repo`
# e.g. `https://github.com/user/homebrew-repo`
def
remote
def
remote
@remote
||=
if
installed?
raise
TapUnavailableError
,
name
unless
installed?
if
git?
&&
Utils
.
git_available?
@remote
||=
path
.
git_origin
path
.
cd
do
Utils
.
popen_read
(
"git"
,
"config"
,
"--get"
,
"remote.origin.url"
).
chomp
end
end
else
raise
TapUnavailableError
,
name
end
end
end
# The default remote path to this {Tap}.
# The default remote path to this {Tap}.
...
@@ -102,35 +96,31 @@ class Tap
...
@@ -102,35 +96,31 @@ class Tap
# True if this {Tap} is a git repository.
# True if this {Tap} is a git repository.
def
git?
def
git?
(
path
/
"
.git
"
).
exist
?
path
.
git?
end
end
# git HEAD for this {Tap}.
# git HEAD for this {Tap}.
def
git_head
def
git_head
raise
TapUnavailableError
,
name
unless
installed?
raise
TapUnavailableError
,
name
unless
installed?
return
unless
git?
&&
Utils
.
git_available?
path
.
git_head
path
.
cd
{
Utils
.
popen_read
(
"git"
,
"rev-parse"
,
"--verify"
,
"-q"
,
"HEAD"
).
chuzzle
}
end
end
# git HEAD in short format for this {Tap}.
# git HEAD in short format for this {Tap}.
def
git_short_head
def
git_short_head
raise
TapUnavailableError
,
name
unless
installed?
raise
TapUnavailableError
,
name
unless
installed?
return
unless
git?
&&
Utils
.
git_available?
path
.
git_short_head
path
.
cd
{
Utils
.
popen_read
(
"git"
,
"rev-parse"
,
"--short=4"
,
"--verify"
,
"-q"
,
"HEAD"
).
chuzzle
}
end
end
# time since git last commit for this {Tap}.
# time since git last commit for this {Tap}.
def
git_last_commit
def
git_last_commit
raise
TapUnavailableError
,
name
unless
installed?
raise
TapUnavailableError
,
name
unless
installed?
return
unless
git?
&&
Utils
.
git_available?
path
.
git_last_commit
path
.
cd
{
Utils
.
popen_read
(
"git"
,
"show"
,
"-s"
,
"--format=%cr"
,
"HEAD"
).
chuzzle
}
end
end
# git last commit date for this {Tap}.
# git last commit date for this {Tap}.
def
git_last_commit_date
def
git_last_commit_date
raise
TapUnavailableError
,
name
unless
installed?
raise
TapUnavailableError
,
name
unless
installed?
return
unless
git?
&&
Utils
.
git_available?
path
.
git_last_commit_date
path
.
cd
{
Utils
.
popen_read
(
"git"
,
"show"
,
"-s"
,
"--format=%cd"
,
"--date=short"
,
"HEAD"
).
chuzzle
}
end
end
# The issues URL of this {Tap}.
# 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