diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2007-01-27 23:56:17 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2007-01-27 23:56:17 +0000 |
commit | 72dbbe3a2cc3550a2aaaf226fd561c0d5064b5b4 (patch) | |
tree | e015170eb18fea6ae15836c8221455b729953f4a /IkiWiki | |
parent | e177dc187ba4d9a48cd18ae1888e7abcbf61fb22 (diff) | |
download | ikiwiki-72dbbe3a2cc3550a2aaaf226fd561c0d5064b5b4.tar ikiwiki-72dbbe3a2cc3550a2aaaf226fd561c0d5064b5b4.tar.gz |
* Make gitorigin_branch and gitmaster_branch configurable via the setup
file. Closes: #408599
Diffstat (limited to 'IkiWiki')
-rw-r--r-- | IkiWiki/Rcs/git.pm | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/IkiWiki/Rcs/git.pm b/IkiWiki/Rcs/git.pm index ad829221c..7f33148e3 100644 --- a/IkiWiki/Rcs/git.pm +++ b/IkiWiki/Rcs/git.pm @@ -8,8 +8,6 @@ use open qw{:utf8 :std}; package IkiWiki; -my $origin_branch = 'origin'; # Git ref for main repository -my $master_branch = 'master'; # working branch my $sha1_pattern = qr/[0-9a-fA-F]{40}/; # pattern to validate Git sha1sums my $dummy_commit_msg = 'dummy commit'; # message to skip in recent changes @@ -112,8 +110,8 @@ sub _merge_past ($$$) { #{{{ # Switch to throw-away branch for the merge operation. push @undo, sub { - if (!run_or_cry('git-checkout', $master_branch)) { - run_or_cry('git-checkout','-f',$master_branch); + if (!run_or_cry('git-checkout', $config{gitmaster_branch})) { + run_or_cry('git-checkout','-f',$config{gitmaster_branch}); } }; run_or_die('git-checkout', $branch); @@ -125,7 +123,7 @@ sub _merge_past ($$$) { #{{{ # _Silently_ commit all modifications in the current branch. run_or_non('git-commit', '-m', $message, '-a'); # ... and re-switch to master. - run_or_die('git-checkout', $master_branch); + run_or_die('git-checkout', $config{gitmaster_branch}); # Attempt to merge without complaining. if (!run_or_non('git-pull', '--no-commit', '.', $branch)) { @@ -287,7 +285,7 @@ sub git_sha1 (;$) { #{{{ sub rcs_update () { #{{{ # Update working directory. - run_or_cry('git-pull', $origin_branch); + run_or_cry('git-pull', $config{gitorigin_branch}); } #}}} sub rcs_prepedit ($) { #{{{ @@ -337,7 +335,7 @@ sub rcs_commit ($$$;$$) { #{{{ $message = possibly_foolish_untaint($message); if (run_or_non('git-commit', '-m', $message, '-i', $file)) { unlockwiki(); - run_or_cry('git-push', $origin_branch); + run_or_cry('git-push', $config{gitorigin_branch}); } return undef; # success |