Commits

ZyX_I committed 332dcbc

@aurum/drivers/git: Fixed (?) rf-commit(): it is now using --all if no files were specified and running rf-add() only on existing files
tests: Added :AuJunk forget and :AuJunk remove tests

Comments (0)

Files changed (3)

plugin/aurum/drivers/git.vim

     endif
     let args=[]
     if a:0
-        if !empty(a:1)
+        if empty(a:1)
+            let kwargs.all=1
+        else
             let args+=['--']+a:1
-            for file in a:1
+            for file in filter(copy(a:1),
+                        \      'filereadable(s:_r.os.path.join(a:repo.path, '.
+                        \                                     'v:val))')
                 call a:repo.functions.add(a:repo, file)
             endfor
         endif
         if a:0>3 && !empty(a:4)
             call s:_f.throw('cbnimp')
         endif
+    else
+        let kwargs.all=1
     endif
     try
         return s:F.gitm(a:repo, 'commit', args, kwargs, 0, 'cif')
 endfunction
 "▶1 git.forget :: repo, file → + FS
 function s:git.forget(repo, file)
-    return s:F.gitm(a:repo, 'rm', ['--',a:file], {'cached':1}, 0, 'fgf',
+    return s:F.gitm(a:repo, 'rm', ['--', a:file], {'cached': 1}, 0, 'fgf',
                 \   escape(a:file, '\'))
 endfunction
 "▶1 git.add :: repo, file → + FS
 :edit ./gittestrepo/newfile.vim
 iW In file newfile.vim:write
 :Run! AuCommit message Added\ newfile.vim date 1990-10-11 user ZyX\ <zyx@example.by> type unknown ./gittestrepo/newfile.vim
-:WT! normal! ggdd
+:WT! 1delete _
 :W{{{1 Commit 2
 oW File newfile.vim, second line:write
 :Run! AuCommit date 1990-10-12 user ZyX\ <zyx@example.by>
 Added second line to newfile.vim
 // It was not required really:write
-:WT! normal! ggdd
+:WT! 1delete _
 :W{{{1 Update
 :AuUpdate HEAD^ ./gittestrepo/
-:WT normal! ggdd
+:WT 1delete _
 :W{{{1 Update: force
 :write!
 :AuUpdate! HEAD^^ ./gittestrepo/
 :WT
 :W{{{1 Update: branch
 :AuUpdate next ./gittestrepo/
-:WT normal! ggdd
+:WT 1delete _
 :edit!
 :W{{{1 Move
 :AuMove ./gittestrepo/--force ./gittestrepo/-f
 :/Commited/delete _
 :Run! echo
 :bwipeout!
+:W{{{1 Track: forget, remove
+:call WriteFile(filereadable('./gittestrepo/-f').filereadable('./gittestrepo/--force'))
+:AuJunk forget ./gittestrepo/-f
+:AuJunk remove ./gittestrepo/--force
+:call WriteFile(filereadable('./gittestrepo/-f').filereadable('./gittestrepo/--force'))
+:AuCommit ./gittestrepo/**
+ggddGld:write
+:WT 1delete _

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.