]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Rcs/git.pm
improve use of seen hash
[git.ikiwiki.info.git] / IkiWiki / Rcs / git.pm
index 8f75399f86262334d41c443dbe001969b54e5b23..84e7d74e58631d0b0930cceaa9722ba52f9f4473 100644 (file)
@@ -285,7 +285,9 @@ sub git_sha1 (;$) { #{{{
 sub rcs_update () { #{{{
        # Update working directory.
 
 sub rcs_update () { #{{{
        # Update working directory.
 
-       run_or_cry('git-pull', $config{gitorigin_branch});
+       if (length $config{gitorigin_branch}) {
+               run_or_cry('git-pull', $config{gitorigin_branch});
+       }
 } #}}}
 
 sub rcs_prepedit ($) { #{{{
 } #}}}
 
 sub rcs_prepedit ($) { #{{{
@@ -333,9 +335,11 @@ sub rcs_commit ($$$;$$) { #{{{
        # git-commit(1) returns non-zero if file has not been really changed.
        # so we should ignore its exit status (hence run_or_non).
        $message = possibly_foolish_untaint($message);
        # git-commit(1) returns non-zero if file has not been really changed.
        # so we should ignore its exit status (hence run_or_non).
        $message = possibly_foolish_untaint($message);
-       if (run_or_non('git-commit', '-m', $message, '-i', $file)) {
+       if (run_or_non('git-commit', '-q', '-m', $message, '-i', $file)) {
                unlockwiki();
                unlockwiki();
-               run_or_cry('git-push', $config{gitorigin_branch});
+               if (length $config{gitorigin_branch}) {
+                       run_or_cry('git-push', $config{gitorigin_branch});
+               }
        }
 
        return undef; # success
        }
 
        return undef; # success