ZyX_I avatar ZyX_I committed 7d08e8f

@aurum/drivers/git: Fixed kwargs.all handling
tests: Added git driver rf-push/pull tests. Fixes #4

Comments (0)

Files changed (8)

plugin/aurum/drivers/git.vim

                 let args+=['--', 'origin']
             endif
             let args+=[a:2]
-            unlet kwargs.all
         endif
     endif
+    if (a:cmd is# 'fetch' && !empty(args)) || len(args)>2
+        unlet kwargs.all
+    endif
     if a:force
         let kwargs.force=1
     endif

test/creategitrepo.zsh

 (
     test -d gittestrepo && rm -rf gittestrepo
     git init gittestrepo
-    cd gittestrepo
+    pushd gittestrepo
     mkdir subdir
     echo 'This is a file with newlines in filename' > $'\nstrange\nfilename\n'
     echo 'This is a file with “ -> ” in filename' > $'abc -> def'
     git merge --no-commit next master
     git commit -m 'Merge of branch next and master' \
         --author 'C <c@example.net>' --date '1990-01-01 13:38:44'
-    cd ..
-    tar -cJvf gittestrepo.tar.xz gittestrepo
 )
+tar cJf gittestrepo.tar.xz gittestrepo
+(
+    test -d gittestbranchedrepo && rm -rf gittestbranchedrepo
+    git init gittestbranchedrepo
+    pushd gittestbranchedrepo
+    function branch() {
+        local -r BRANCH=$1
+        git checkout master
+        git checkout -b $BRANCH
+        echo $BRANCH > a
+        git commit -a -m "Added branch $BRANCH" \
+            --date '1990-01-01 00:00' --author 'A <a@example.pl>'
+    }
+    echo a>a
+    git checkout -b master
+    git add a
+    git commit -m 'Added a' \
+        --date '1990-01-01 00:00' --author 'A <a@example.pl>'
+    branch A
+    branch B
+    tar cJf ../drivers-git-first-two.tar.xz .
+    branch C
+    branch D
+    branch E
+    branch F
+)
+tar cJf gittestbranchedrepo.tar.xz gittestbranchedrepo

test/createhgrepo.zsh

 local -x HGRCPATH=''
 . virtualenvwrapper.sh
 (
+    test -d hgtestrepo && rm -rf hgtestrepo
     workon mercurial-1.2
     hg init hgtestrepo
     cd hgtestrepo
 )
 tar cJf hgtestrepo.tar.xz hgtestrepo
 (
+    test -d hgtestbranchedrepo && rm -rf hgtestbranchedrepo
     workon mercurial-1.2
     hg init hgtestbranchedrepo
     pushd hgtestbranchedrepo
Add a comment to this file

test/drivers-git-first-two.tar.xz

Binary file added.

test/drivers-git.in

 :AuJunk ignoreglob ./gittestrepo/ignored*
 :W{{{2 Status after junk
 :Run! AuStatus ./gittestrepo/
+:bwipeout
 :W{{{2 gitignore contents
 :call WriteFile(readfile('./gittestrepo/.gitignore', 'b'))
+:bwipeout
+:W{{{1 Other: push, pull
+:W{{{2 push
+:AuOther push C drivers-git-A gittestbranchedrepo
+:Run! AuLog drivers-git-A
+:bwipeout
+:W{{{2 pull
+:AuOther pull D gittestbranchedrepo drivers-git-A
+:AuUpdate FETCH_HEAD drivers-git-A
+:Run! AuLog drivers-git-A
+:bwipeout
+:W{{{2 forced push
+:AuOther! push A gitteststatusrepo drivers-git-A
+:Run! AuLog gitteststatusrepo
+:bwipeout
+:W{{{2 forced pull
+:AuOther! pull : gittestbranchedrepo gitteststatusrepo
+:Run! AuLog gitteststatusrepo
+:bwipeout

Binary file modified.

test/gentests-setuptestrepos.zsh

 
 tar xJf gittestrepo.tar.xz
 tar xJf gitteststatusrepo.tar.xz
+tar xJf gittestbranchedrepo.tar.xz
+mkdir drivers-git-A && (cd drivers-git-A && tar xJf ../drivers-git-first-two.tar.xz)
 
 tar xJf svntestreposerver.tar.xz
 mkdir svntestrepo-subdirserver
Add a comment to this file

test/gittestbranchedrepo.tar.xz

Binary file added.

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.