diff options
author | root <root@localhost> | 2013-02-14 00:00:00 +0000 |
---|---|---|
committer | root <root@localhost> | 2013-02-14 00:00:00 +0000 |
commit | f0c85162c8d4a13eb52132e214307d4c43153394 (patch) | |
tree | 27cebb7f21e7dc2a16ba3f31f1775b192706e288 /git-remote-gcrypt | |
parent | d677056404e294c3fb7f9e037f23a4a754adb8ca (diff) | |
download | git-remote-gcrypt-f0c85162c8d4a13eb52132e214307d4c43153394.tar.gz |
Use only one git push for each push through gitception://
Diffstat (limited to 'git-remote-gcrypt')
-rwxr-xr-x | git-remote-gcrypt | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/git-remote-gcrypt b/git-remote-gcrypt index be50fa6..94860bd 100755 --- a/git-remote-gcrypt +++ b/git-remote-gcrypt @@ -81,8 +81,6 @@ update_tree() # Put repo $1, file $2 or fail PUT() { - local REPO - if isurl ssh "$1" then splitcolon "${1#ssh://}" @@ -92,17 +90,28 @@ PUT() curl -s -S -k --ftp-create-dirs -T - "$1/$2" elif isurl gitception "$1" then - REPO=${1#gitception://} OBJID=$(git hash-object -w --stdin) && \ TREEID=$(update_tree "$GREF" "$2" "$OBJID") && COMMITID=$(anon_commit "$TREEID" -m "x") && \ - git push -f "$REPO" "$COMMITID":master && \ git update-ref "$GREF" "$COMMITID" else cat > "$1/$2" fi } +# Put all PUT changes for repo $1 at once +PUT_FINAL() +{ + local REPO + if isurl gitception "$1" + then + REPO=${1#gitception://} + git push --quiet -f "$REPO" "$GREF":master + else + : + fi +} + # Put directory for repo $1 PUTREPO() { @@ -363,6 +372,8 @@ do_push() printf "%s\n%s\n" "$BRANCHLIST" "$PACKLIST" | \ CLEARSIGN | ENCRYPT | PUT "$URL" "manifest" + PUT_FINAL "$URL" + # ok all updates (not deletes) printf "%s\n" "$1" | while read LINE do |