1. ZyX_I
  2. aurum


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

  • Participants
  • Parent commits 02fe47b
  • Branches default

Comments (0)

Files changed (3)

File plugin/aurum/drivers/git.vim

View file
     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)
         if a:0>3 && !empty(a:4)
             call s:_f.throw('cbnimp')
+    else
+        let kwargs.all=1
         return s:F.gitm(a:repo, 'commit', args, kwargs, 0, 'cif')
 "▶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, '\'))
 "▶1 git.add :: repo, file → + FS

File test/git.in

View file
 :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
 :AuUpdate! HEAD^^ ./gittestrepo/
 :W{{{1 Update: branch
 :AuUpdate next ./gittestrepo/
-:WT normal! ggdd
+:WT 1delete _
 :W{{{1 Move
 :AuMove ./gittestrepo/--force ./gittestrepo/-f
 :/Commited/delete _
 :Run! echo
+: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/**
+:WT 1delete _

File test/git.ok

Binary file modified.