diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2016-06-19 02:05:26 +0200 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2016-06-19 02:05:26 +0200 |
commit | d684352ff8ca444b8cdb9d05ba90a23e36a6ffe7 (patch) | |
tree | 359c23170a943b5471ec4bb5a9d239d977856cf3 /src | |
parent | 35fa51a9c0f86fee3d1c81bc15571400c6a23c50 (diff) | |
download | blogc-d684352ff8ca444b8cdb9d05ba90a23e36a6ffe7.tar.gz blogc-d684352ff8ca444b8cdb9d05ba90a23e36a6ffe7.tar.bz2 blogc-d684352ff8ca444b8cdb9d05ba90a23e36a6ffe7.zip |
git-receiver: fixed repository mirroring
old git versions does not have 'git remote get-url' command.
Diffstat (limited to 'src')
-rw-r--r-- | src/blogc-git-receiver.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/blogc-git-receiver.c b/src/blogc-git-receiver.c index ffeac61..084a778 100644 --- a/src/blogc-git-receiver.c +++ b/src/blogc-git-receiver.c @@ -282,8 +282,12 @@ cleanup: static int git_post_receive_hook(int argc, char *argv[]) { - if (0 != system("git remote get-url --push mirror &> /dev/null")) - return 0; + if (0 != system("git config remote.mirror.pushurl &> /dev/null")) { + if (0 != system("git config remote.mirror.url &> /dev/null")) { + fprintf(stderr, "warning: repository mirroring disabled\n"); + return 0; + } + } // at this point we know that we have a remote called mirror, we can just // push to it. |