Commits

ZyX_I committed e9f0735

@%aurum/commit: Fixed error in case getrrf returns files=0 and :AuC all was used
tests: Improved git tests

Comments (0)

Files changed (4)

autoload/aurum/commit.vim

 "▶1 commfunc
 function s:cmd.function(opts, ...)
     let rrfopts=copy(a:opts)
-    if a:0 && index(a:000, 'all')==-1
+    let hasall=index(a:000, 'all')!=-1
+    if a:0 && !hasall
         let rrfopts.files=a:000
     endif
     let [repo, rev, files]=s:_r.cmdutils.getrrf(rrfopts,
     let status=repo.functions.status(repo)
     "▶2 Get file list
     let types=['modified', 'added', 'removed']
-    if a:0 && index(a:000, 'all')!=-1
+    if hasall
+        unlet files
         let files=[]
     elseif a:0
         if has_key(a:opts, 'type')

test/addEmessages.vim

+redir => s:messages
+messages
+redir END
+let s:meslines=filter(split(s:messages, "\n")[1:], 'v:val=~#"\\v^E\\d+\\:"')
+if !empty(s:meslines)
+    call WriteFile(['>>> Error Messages:']+
+                \  s:meslines+
+                \  ['<<< Error Messages^'])
+endif

test/drivers-git.in

 :let g:curtest='gittest'
 :let g:tipname='HEAD'
-:W{{{1 Annotate
-:Run! AuAnnotate file ./gittestrepo/* | wincmd w
-:bwipeout!
-:bwipeout!
 :W{{{1 Branch
 :AuBranch next3 repo ./gittestrepo/
 :WT
 Added second line to newfile.vim
 // It was not required really:write
 :WT! 1delete _
+:bwipeout!
+:W{{{1 File :
+:Run AuFile : *
+:bwipeout!
+:W{{{1 File HEAD
+:Run AuFile HEAD newfile.vim
+:bwipeout!
+:W{{{1 File HEAD^
+:Run AuFile HEAD^ newfile.vim
+:bwipeout!
+:W{{{1 Annotate newfile.vim
+:R AuAnnotate file newfile.vim | wincmd p | call WriteFile(map(getline(1, '$'), 'v:val[stridx(v:val, " "):]'))
+:bwipeout!
+:bwipeout!
+:W{{{1 Diff changes
+:Run AuDiff changes HEAD^^^^
+:bwipeout!
+:W{{{1 Diff rev2
+:Run AuDiff rev2 HEAD^^^^^
+:bwipeout!
+:W{{{1 Diff rev1+rev2
+:Run AuDiff rev1 HEAD^^^^^ rev2 HEAD^^^^
+:bwipeout!
 :W{{{1 Update
 :AuUpdate HEAD^ ./gittestrepo/
 :WT 1delete _
 :W{{{1 Update: force
+:R e newfile.vim
+:AuFile next replace
 :write!
-:AuUpdate! HEAD^^ ./gittestrepo/
+:AuUpdate! HEAD^^
 :WT
 :W{{{1 Update: branch
-:AuUpdate next ./gittestrepo/
+:AuUpdate next
 :WT 1delete _
-:edit!
+:bwipeout!
 :W{{{1 Move
 :AuMove ./gittestrepo/--force ./gittestrepo/-f
 :AuCommit message Moved\ --force\ to\ -f repo ./gittestrepo/ all
 :Run! AuGrep W ignorecase repo ./gittestrepo/ | cwindow
 :cclose
 :W{{{1 Grep: HEAD^^^^
-:let repo=aurum#repository()
+:R let g:repo=aurum#repository()
 :let cs=repo.functions.getcs(repo, 'HEAD^^^^')
-:AuGrep W revision HEAD^^^^ repo ./gittestrepo/ | cwindow
+:AuGrep W revision HEAD^^^^ repo ./gittestrepo | cwindow
 :call WriteFile(map(getline(1, '$'), 'substitute(v:val, "'.cs.hex.'", "HEAD^^^^", "g")'))
 :cclose
 :W{{{1 Junk: ignore, ignoreglob
 :AuOther! pull : gittestbranchedrepo gitteststatusrepo
 :Run! AuLog gitteststatusrepo
 :bwipeout
+:source addEmessages.vim

Binary file modified.

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.