Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
O
oh-my-fish
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
oh-my-fish
Commits
61f71f3c
Commit
61f71f3c
authored
Sep 06, 2015
by
Bruno Pinto
Committed by
Derek Stavis
Sep 06, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace `omf.update` with `omf.repo.pull`
- Pull repository from origin unless upstream exist.
parent
890104ab
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
19 deletions
+11
-19
pkg/omf/cli/omf.repo.pull.fish
pkg/omf/cli/omf.repo.pull.fish
+10
-2
pkg/omf/cli/omf.update.fish
pkg/omf/cli/omf.update.fish
+0
-16
pkg/omf/omf.fish
pkg/omf/omf.fish
+1
-1
No files found.
pkg/omf/cli/omf.repo.pull.fish
View file @
61f71f3c
function omf.repo.pull
if test (command git config --get remote.upstream.url)
set repository upstream
else
set repository origin
end
set initial_branch (command git symbolic-ref -q --short HEAD); or return $OMF_UNKNOWN_ERR
set initial_revision (command git rev-parse -q --verify HEAD); or return $OMF_UNKNOWN_ERR
...
...
@@ -14,8 +20,8 @@ function omf.repo.pull
command git checkout master --quiet
end
# the refspec ensures that '
origin
/master' gets updated
command git pull --rebase --quiet
origin "refs/heads/master:refs/remotes/origin
/master"
# the refspec ensures that '
$repository
/master' gets updated
command git pull --rebase --quiet
$repository "refs/heads/master:refs/remotes/$repository
/master"
if test $status -eq 2 #SIGINT
command git checkout $initial_branch
command git reset --hard $initial_revision
...
...
@@ -32,4 +38,6 @@ function omf.repo.pull
echo (omf::em)"Restored your changes:"(omf::off)
command git status --short --untracked-files
end
return 0
end
pkg/omf/cli/omf.update.fish
deleted
100644 → 0
View file @
890104ab
function omf.update
set -l repo "upstream"
test -z (git config --get remote.upstream.url)
and set -l repo "origin"
if git diff-index --quiet HEAD -- >/dev/null ^&1
git pull $repo master >/dev/null ^&1
else
git stash >/dev/null ^&1
if git pull --rebase $repo master >/dev/null ^&1
git stash apply >/dev/null ^&1
else
omf.repo.sync
end
end
end
pkg/omf/omf.fish
View file @
61f71f3c
...
...
@@ -125,7 +125,7 @@ function omf -d "Oh My Fish"
case "u" "up" "upd" "update"
pushd $OMF_PATH
echo (omf::em)"Updating Oh My Fish..."(omf::off)
if omf.
update
if omf.
repo.pull
echo (omf::em)"Oh My Fish is up to date."(omf::off)
else
echo (omf::err)"Oh My Fish failed to update."(omf::off)
...
...
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