ZyX_I  committed 7d08e8f

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

  • Participants
  • Parent commits eeefa97
  • Tags release-1.4.9

Comments (0)

Files changed (8)

File plugin/aurum/drivers/git.vim

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

File 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 <>' --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 <>'
+    }
+    echo a>a
+    git checkout -b master
+    git add a
+    git commit -m 'Added a' \
+        --date '1990-01-01 00:00' --author 'A <>'
+    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

File test/createhgrepo.zsh

 local -x HGRCPATH=''
+    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

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

Binary file added.

File test/

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

File test/drivers-git.ok

Binary file modified.

File 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

File test/gittestbranchedrepo.tar.xz

Binary file added.