Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
vimagit
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
jreybert
vimagit
Commits
f2617811
Commit
f2617811
authored
Oct 6, 2015
by
Jerome Reybert
Browse files
Options
Downloads
Patches
Plain Diff
test/: fix test for subdir
parent
c8bc49e7
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
test/addFile.vader
+2
-0
2 additions, 0 deletions
test/addFile.vader
test/cleanup.inc
+1
-1
1 addition, 1 deletion
test/cleanup.inc
test/utils.vim
+16
-3
16 additions, 3 deletions
test/utils.vim
with
19 additions
and
4 deletions
test/addFile.vader
+
2
−
0
View file @
f2617811
...
@@ -2,10 +2,12 @@ Include: setup.inc
...
@@ -2,10 +2,12 @@ Include: setup.inc
# add test
# add test
Execute (Add file):
Execute (Add file):
call Cd_test_sub()
Magit
Magit
/untracked: bootstrap
/untracked: bootstrap
call Move_relative(+1)
call Move_relative(+1)
call magit#stage_file()
call magit#stage_file()
call Cd_test()
call Git_diff('staged', 'bootstrap', '/tmp/addFile_bootstrap.test')
call Git_diff('staged', 'bootstrap', '/tmp/addFile_bootstrap.test')
call Expect_diff(g:test_dir . 'addFile_bootstrap.expect', '/tmp/addFile_bootstrap.test')
call Expect_diff(g:test_dir . 'addFile_bootstrap.expect', '/tmp/addFile_bootstrap.test')
...
...
This diff is collapsed.
Click to expand it.
test/cleanup.inc
+
1
−
1
View file @
f2617811
Execute
(
cleanup
)
:
Execute
(
cleanup
)
:
call
system
(
"git reset --hard "
.
$TEST_HEAD_SHA1
)
call
system
(
"git reset --hard "
.
$TEST_HEAD_SHA1
)
c
d
$VIMAGIT_PATH
c
all
Cd_vimagit
()
This diff is collapsed.
Click to expand it.
test/utils.vim
+
16
−
3
View file @
f2617811
...
@@ -11,10 +11,11 @@ endfunction
...
@@ -11,10 +11,11 @@ endfunction
function
!
Git_diff
(
state
,
file
,
output
)
function
!
Git_diff
(
state
,
file
,
output
)
let
staged_flag
=
(
a:state
==
'staged'
)
?
' --staged '
:
''
let
staged_flag
=
(
a:state
==
'staged'
)
?
' --staged '
:
''
let
diff
=
system
(
"git diff --no-color --no-ext-diff --src-prefix='' --dst-prefix='' "
.
let
diff
_cmd
=
"git diff --no-color --no-ext-diff --src-prefix='' --dst-prefix='' "
.
\
staged_flag
.
a:file
.
\
staged_flag
.
" -- "
.
a:file
.
\
" | \\grep -v \"^index [[:xdigit:]]\\{7\\}\\.\\.[[:xdigit:]]\\{7\\}\" > "
.
\
" | \\grep -v \"^index [[:xdigit:]]\\{7\\}\\.\\.[[:xdigit:]]\\{7\\}\" > "
.
\
a:output
)
\
a:output
)
let
diff
=
system
(
diff_cmd
)
if
(
v
:
shell_error
!=
0
)
if
(
v
:
shell_error
!=
0
)
echoerr
"git diff: "
.
diff
echoerr
"git diff: "
.
diff
endif
endif
...
@@ -24,7 +25,19 @@ endfunction
...
@@ -24,7 +25,19 @@ endfunction
function
!
Expect_diff
(
gold_file
,
test_file
)
function
!
Expect_diff
(
gold_file
,
test_file
)
let
diff
=
system
(
"diff "
.
a:gold_file
.
" "
.
a:test_file
)
let
diff
=
system
(
"diff "
.
a:gold_file
.
" "
.
a:test_file
)
if
(
v
:
shell_error
!=
0
)
if
(
v
:
shell_error
!=
0
)
echoerr
"
git
diff: "
.
diff
echoerr
"diff: "
.
diff
endif
endif
return
v
:
shell_error
return
v
:
shell_error
endfunction
endfunction
function
!
Cd_vimagit
()
cd
$VIMAGIT_PATH
endfunction
function
!
Cd_test
()
cd
$TEST_PATH
endfunction
function
!
Cd_test_sub
()
cd
$TEST_SUB_PATH
endfunction
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
sign in
to comment