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
d536e5d2
Commit
d536e5d2
authored
9 years ago
by
Jerome Reybert
Browse files
Options
Downloads
Patches
Plain Diff
test/: don't use temp file to store diff
parent
f2617811
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/addFile.vader
+2
-2
2 additions, 2 deletions
test/addFile.vader
test/utils.vim
+5
-6
5 additions, 6 deletions
test/utils.vim
with
7 additions
and
8 deletions
test/addFile.vader
+
2
−
2
View file @
d536e5d2
...
...
@@ -8,7 +8,7 @@ Execute (Add file):
call Move_relative(+1)
call magit#stage_file()
call Cd_test()
call
Git_diff('staged', 'bootstrap'
, '/tmp/addFile_bootstrap.test'
)
call Expect_diff(g:test_dir . 'addFile_bootstrap.expect',
'/tmp/addFile_bootstrap.test'
)
let diff=
Git_diff('staged', 'bootstrap')
call Expect_diff(g:test_dir . 'addFile_bootstrap.expect',
diff
)
Include: cleanup.inc
This diff is collapsed.
Click to expand it.
test/utils.vim
+
5
−
6
View file @
d536e5d2
...
...
@@ -9,21 +9,20 @@ function! Move_relative(nb_lines)
call
cursor
(
line
(
'.'
)
+
a:nb_lines
,
0
)
endfunction
function
!
Git_diff
(
state
,
file
,
output
)
function
!
Git_diff
(
state
,
file
)
let
staged_flag
=
(
a:state
==
'staged'
)
?
' --staged '
:
''
let
diff_cmd
=
"git diff --no-color --no-ext-diff --src-prefix='' --dst-prefix='' "
.
\
staged_flag
.
" -- "
.
a:file
.
\
" | \\grep -v \"^index [[:xdigit:]]\\{7\\}\\.\\.[[:xdigit:]]\\{7\\}\" > "
.
\
a:output
)
\
" | \\grep -v \"^index [[:xdigit:]]\\{7\\}\\.\\.[[:xdigit:]]\\{7\\}\""
let
diff
=
system
(
diff_cmd
)
if
(
v
:
shell_error
!=
0
)
echoerr
"git diff: "
.
diff
endif
return
v
:
shell_error
return
diff
endfunction
function
!
Expect_diff
(
gold_file
,
test_
file
)
let
diff
=
system
(
"diff "
.
a:gold_file
.
"
"
.
a:test_
file
)
function
!
Expect_diff
(
gold_file
,
test_
diff
)
let
diff
=
system
(
"diff "
.
a:gold_file
.
"
- "
,
a:test_
diff
)
if
(
v
:
shell_error
!=
0
)
echoerr
"diff: "
.
diff
endif
...
...
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