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
56b1d837
Commit
56b1d837
authored
Sep 21, 2015
by
jeremiejig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changing to git -C to git --git-dir work-tree
parent
5cdde263
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
19 deletions
+19
-19
bin/install
bin/install
+4
-4
pkg/omf/cli/omf.repo.pull.fish
pkg/omf/cli/omf.repo.pull.fish
+15
-15
No files found.
bin/install
View file @
56b1d837
...
...
@@ -58,13 +58,13 @@ omf_install() {
die
"Could not clone the repository →
${
OMF_PATH
}
:
${
OMF_REPO_BRANCH
}
"
fi
local
git_rev
=
$(
git
-
C
${
OMF_PATH
}
rev-parse HEAD
)
>
/dev/null 2>&1
local
git_upstream
=
$(
git
-
C
${
OMF_PATH
}
config remote.upstream.url
)
local
git_rev
=
$(
git
-
-git-dir
${
OMF_PATH
}
/.git
--work-tree
${
OMF_PATH
}
rev-parse HEAD
)
>
/dev/null 2>&1
local
git_upstream
=
$(
git
-
-git-dir
${
OMF_PATH
}
/.git
--work-tree
${
OMF_PATH
}
config remote.upstream.url
)
if
[
-z
"
${
git_upstream
}
"
]
;
then
git
-
C
${
OMF_PATH
}
remote add upstream
${
git_uri
}
git
-
-git-dir
${
OMF_PATH
}
/.git
--work-tree
${
OMF_PATH
}
remote add upstream
${
git_uri
}
else
git
-
C
${
OMF_PATH
}
remote set-url upstream
${
git_uri
}
git
-
-git-dir
${
OMF_PATH
}
/.git
--work-tree
${
OMF_PATH
}
remote set-url upstream
${
git_uri
}
fi
echo
"Oh My Fish revision id →
${
git_rev
}
"
...
...
pkg/omf/cli/omf.repo.pull.fish
View file @
56b1d837
...
...
@@ -3,46 +3,46 @@ function omf.repo.pull
echo (omf::err)"Argument of omf.repo.pull is the repo path."(omf::off)
return $OMF_MISSING_ARG
end
set -l
git
_dir $argv[1]
set -l
repo
_dir $argv[1]
if test (command git -
C "$git
_dir" config --get remote.upstream.url)
if test (command git -
-git-dir "$repo_dir"/.git --work-tree "$repo
_dir" config --get remote.upstream.url)
set repository upstream
else
set repository origin
end
set initial_branch (command git -
C "$git
_dir" symbolic-ref -q --short HEAD); or return $OMF_UNKNOWN_ERR
set initial_revision (command git -
C "$git
_dir" rev-parse -q --verify HEAD); or return $OMF_UNKNOWN_ERR
set initial_branch (command git -
-git-dir "$repo_dir"/.git --work-tree "$repo
_dir" symbolic-ref -q --short HEAD); or return $OMF_UNKNOWN_ERR
set initial_revision (command git -
-git-dir "$repo_dir"/.git --work-tree "$repo
_dir" rev-parse -q --verify HEAD); or return $OMF_UNKNOWN_ERR
if not command git -
C "$git
_dir" diff --quiet
if not command git -
-git-dir "$repo_dir"/.git --work-tree "$repo
_dir" diff --quiet
echo (omf::em)"Stashing your changes:"(omf::off)
command git -
C "$git
_dir" status --short --untracked-files
command git -
-git-dir "$repo_dir"/.git --work-tree "$repo
_dir" status --short --untracked-files
command git -
C "$git
_dir" stash save --include-untracked --quiet
command git -
-git-dir "$repo_dir"/.git --work-tree "$repo
_dir" stash save --include-untracked --quiet
set stashed true
end
if test "$initial_branch" != master
command git -
C "$git
_dir" checkout master --quiet
command git -
-git-dir "$repo_dir"/.git --work-tree "$repo
_dir" checkout master --quiet
end
# the refspec ensures that '$repository/master' gets updated
command git -
C "$git
_dir" pull --rebase --quiet $repository "refs/heads/master:refs/remotes/$repository/master"
command git -
-git-dir "$repo_dir"/.git --work-tree "$repo
_dir" pull --rebase --quiet $repository "refs/heads/master:refs/remotes/$repository/master"
if test $status -eq 2 #SIGINT
command git -
C "$git
_dir" checkout $initial_branch
command git -
C "$git
_dir" reset --hard $initial_revision
test "$stashed" = true; and command git -
C "$git
_dir" stash pop
command git -
-git-dir "$repo_dir"/.git --work-tree "$repo
_dir" checkout $initial_branch
command git -
-git-dir "$repo_dir"/.git --work-tree "$repo
_dir" reset --hard $initial_revision
test "$stashed" = true; and command git -
-git-dir "$repo_dir"/.git --work-tree "$repo
_dir" stash pop
end
if test "$initial_branch" != master
command git -
C "$git
_dir" checkout $initial_branch --quiet
command git -
-git-dir "$repo_dir"/.git --work-tree "$repo
_dir" checkout $initial_branch --quiet
end
if test "$stashed" = true
command git -
C "$git
_dir" stash pop --quiet
command git -
-git-dir "$repo_dir"/.git --work-tree "$repo
_dir" stash pop --quiet
echo (omf::em)"Restored your changes:"(omf::off)
command git -
C "$git
_dir" status --short --untracked-files
command git -
-git-dir "$repo_dir"/.git --work-tree "$repo
_dir" status --short --untracked-files
end
return 0
...
...
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