Commit Graph

429 Commits

Author SHA1 Message Date
Toshi MARUYAMA
118fff34aa rubocop: fix Style/YodaCondition of lib/redmine/scm/adapters/abstract_adapter.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@18351 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-08-04 17:05:24 +00:00
Toshi MARUYAMA
37cde69d50 rubocop: fix Layout/EmptyLinesAroundAccessModifier of lib/redmine/scm/adapters/cvs_adapter.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@18340 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-08-03 05:34:20 +00:00
Toshi MARUYAMA
00d3fa02e2 rubocop: fix Layout/AccessModifierIndentation of scm/adapters/abstract_adapter.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@18331 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-07-29 05:38:30 +00:00
Go MAEDA
c2b30f5d3d Code cleanup: RuboCop: Style/DefWithParentheses
git-svn-id: http://svn.redmine.org/redmine/trunk@18290 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-06-20 12:15:28 +00:00
Go MAEDA
9eafc3e9a2 Remove trailing whitespaces from lib (#31506).
Patch by Marius BALTEANU.


git-svn-id: http://svn.redmine.org/redmine/trunk@18231 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-06-06 14:50:14 +00:00
Go MAEDA
97f05de373 Update copyright year.
git-svn-id: http://svn.redmine.org/redmine/trunk@18199 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-05-25 22:42:47 +00:00
Go MAEDA
4082069c75 Update copyright year.
git-svn-id: http://svn.redmine.org/redmine/trunk@18198 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-05-25 07:36:06 +00:00
Go MAEDA
b0e17e8199 Don't rescue Exception class (#31387).
Patch by Go MAEDA and Pavel Rosický.


git-svn-id: http://svn.redmine.org/redmine/trunk@18197 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-05-25 06:50:25 +00:00
Go MAEDA
ba79c59f9f Garbage lines in the output of 'git branch' break git adapter (#31120).
Contributed by Chad Petersen.


git-svn-id: http://svn.redmine.org/redmine/trunk@18046 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-04-07 07:02:08 +00:00
Toshi MARUYAMA
dcd7df0be8 code clean up GitAdapter
git-svn-id: http://svn.redmine.org/redmine/trunk@18043 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-04-05 07:49:08 +00:00
Toshi MARUYAMA
ec557a67a4 scm: git: fix non ascii branch and tag browsing (#16881)
git-svn-id: http://svn.redmine.org/redmine/trunk@18042 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-04-05 07:41:08 +00:00
Toshi MARUYAMA
ae0939952e scm: git: add new one latin1 tag to test repository (#16881)
git-svn-id: http://svn.redmine.org/redmine/trunk@18040 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-04-05 06:48:37 +00:00
Toshi MARUYAMA
5d2c03a196 scm: git: add new two latin1 branches to test repository (#16881)
git-svn-id: http://svn.redmine.org/redmine/trunk@18039 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-04-05 05:30:18 +00:00
Toshi MARUYAMA
97f6a40981 code clean up GitAdapter
git-svn-id: http://svn.redmine.org/redmine/trunk@18038 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-04-04 16:33:02 +00:00
Toshi MARUYAMA
3d70e1079a code clean up GitAdapter
git-svn-id: http://svn.redmine.org/redmine/trunk@18037 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-04-04 07:15:32 +00:00
Go MAEDA
72e1451159 Use Regexp#match? to reduce allocations of MatchData object (#28940).
Patch by Pavel Rosický.


git-svn-id: http://svn.redmine.org/redmine/trunk@18011 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-03-27 02:15:24 +00:00
Go MAEDA
4a37bac866 Remove extra #dup (#26561).
git-svn-id: http://svn.redmine.org/redmine/trunk@17995 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-03-21 00:45:56 +00:00
Go MAEDA
21769bb59e Fix FrozenError in BazaarAdapter.branch_conf_path (#26561).
Patch by Go MAEDA.


git-svn-id: http://svn.redmine.org/redmine/trunk@17994 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-03-20 15:02:35 +00:00
Go MAEDA
606e75d12d Use #b shortcut instead of #force_encoding (#31059).
Patch by Pavel Rosický.


git-svn-id: http://svn.redmine.org/redmine/trunk@17992 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-03-20 01:36:44 +00:00
Go MAEDA
30e341db69 Support frozen_string_literal in lib/**/*.rb (#26561).
Contributed by Pavel Rosický.


git-svn-id: http://svn.redmine.org/redmine/trunk@17988 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-03-17 16:36:34 +00:00
Go MAEDA
d16369b67c Enable frozen_string_literal for files which don't contain string literals (#26561).
git-svn-id: http://svn.redmine.org/redmine/trunk@17981 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-03-17 01:47:12 +00:00
Go MAEDA
5861160ffc Add "frozen_string_literal: false" for all files (#26561).
This will be changed to true in the future.


git-svn-id: http://svn.redmine.org/redmine/trunk@17947 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-03-15 01:32:57 +00:00
Go MAEDA
7b20e4c034 Refactor GitAdapter#default_branch not to unnecessarily iterate through all elements (#30828).
Patch by  Pavel Rosický.


git-svn-id: http://svn.redmine.org/redmine/trunk@17883 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-02-18 23:19:39 +00:00
Jean-Philippe Lang
8f58496138 Filesystem adapter does not show correct size for large files (#30411).
git-svn-id: http://svn.redmine.org/redmine/trunk@17831 e93f8b46-1217-0410-a6f0-8f06a7374b81
2019-01-20 07:39:13 +00:00
Go MAEDA
9709f8f364 Mercurial 4.7 compatibility (#29413).
Patch by Frédéric Fondement.


git-svn-id: http://svn.redmine.org/redmine/trunk@17474 e93f8b46-1217-0410-a6f0-8f06a7374b81
2018-08-25 08:40:32 +00:00
Go MAEDA
b7f15fbadc Replace String#gsub with faster String#tr (#29363).
Patch by Go MAEDA.


git-svn-id: http://svn.redmine.org/redmine/trunk@17469 e93f8b46-1217-0410-a6f0-8f06a7374b81
2018-08-12 23:40:44 +00:00
Go MAEDA
eee1c36b4b Replace Enumerable#sort with faster Enumerable#sort_by (#29299).
Patch by Go MAEDA.


git-svn-id: http://svn.redmine.org/redmine/trunk@17462 e93f8b46-1217-0410-a6f0-8f06a7374b81
2018-08-02 21:54:21 +00:00
Go MAEDA
bff0fbce8b Remove RDoc tags (#28943).
Patch by Sho HASHIMOTO.


git-svn-id: http://svn.redmine.org/redmine/trunk@17370 e93f8b46-1217-0410-a6f0-8f06a7374b81
2018-06-08 00:55:41 +00:00
Go MAEDA
eafe8a9f9e Mercurial 4.6 compatibility (#28725).
Patch by Marc Schlaich and Frédéric Fondement.


git-svn-id: http://svn.redmine.org/redmine/trunk@17351 e93f8b46-1217-0410-a6f0-8f06a7374b81
2018-05-28 09:40:15 +00:00
Toshi MARUYAMA
9d797400ea mercurial: work around faulty parsing of early command options (#27516)
Use -sVALUE and --long=VALUE instead of "-s VALUE" and "--long VALUE"
respectively.

Contributed by Yuya Nishihara.

git-svn-id: http://svn.redmine.org/redmine/trunk@17062 e93f8b46-1217-0410-a6f0-8f06a7374b81
2017-12-07 11:38:47 +00:00
Toshi MARUYAMA
58ed865513 mercurial: separate command options and positional arguments with "--" (#27516)
We don't have much problems here thanks to hgtarget(path) and CGI.escape(),
which prepends a repository path and encodes "=" character respectively, but
it's better to not rely on the side effect of these functions.

Contributed by Yuya Nishihara.

git-svn-id: http://svn.redmine.org/redmine/trunk@17061 e93f8b46-1217-0410-a6f0-8f06a7374b81
2017-12-07 11:38:35 +00:00
Toshi MARUYAMA
ca87bf766c mercurial: reject malicious command argument (#27516)
We've got a security report from the Phabricator team, which basically says
--config and --debugger arguments can be injected anywhere to lead to an
arbitrary command execution.

https://secure.phabricator.com/rPa7921a4448093d00defa8bd18f35b8c8f8bf3314

This is a fundamental issue of the argument parsing rules in Mercurial, which
allows extensions to populate their parsing rules and such extensions can be
loaded by "--config extensions.<name>=". There's a chicken and egg problem.
We're working on hardening the parsing rules, but which won't come in by
default as it would be a behavior change.

This patch adds a verification to reject malicious command arguments as a
last ditch. The subsequent patches will fix the problem in more appropriate
way.

Contributed by Yuya Nishihara.

git-svn-id: http://svn.redmine.org/redmine/trunk@17060 e93f8b46-1217-0410-a6f0-8f06a7374b81
2017-12-07 11:38:23 +00:00
Toshi MARUYAMA
432cf42b47 git: remove "--no-color" option from "git --version" for git 2.14 compatibility (#26645)
git-svn-id: http://svn.redmine.org/redmine/trunk@16948 e93f8b46-1217-0410-a6f0-8f06a7374b81
2017-08-08 05:10:32 +00:00
Jean-Philippe Lang
0910b2bdbe Drop Darcs support (#26391).
Patch by Go MAEDA.

git-svn-id: http://svn.redmine.org/redmine/trunk@16886 e93f8b46-1217-0410-a6f0-8f06a7374b81
2017-07-25 17:32:53 +00:00
Jean-Philippe Lang
7fd04e1f8d Update copyright.
git-svn-id: http://svn.redmine.org/redmine/trunk@16685 e93f8b46-1217-0410-a6f0-8f06a7374b81
2017-06-25 08:40:31 +00:00
Jean-Philippe Lang
5744bfc2c6 Removes duplicate shell_quote method (#26149).
Patch by Jens Krämer.

git-svn-id: http://svn.redmine.org/redmine/trunk@16667 e93f8b46-1217-0410-a6f0-8f06a7374b81
2017-06-17 07:42:54 +00:00
Toshi MARUYAMA
06babbec7e remove is_binary_data? from String (#25563)
git-svn-id: http://svn.redmine.org/redmine/trunk@16644 e93f8b46-1217-0410-a6f0-8f06a7374b81
2017-06-10 04:29:15 +00:00
Toshi MARUYAMA
14cfe2c67a git: use '--no-renames' option in 'show' command (#25371)
git-svn-id: http://svn.redmine.org/redmine/trunk@16428 e93f8b46-1217-0410-a6f0-8f06a7374b81
2017-03-24 15:53:04 +00:00
Toshi MARUYAMA
47dff44278 Git 2.9 compatibility (#25371)
git-svn-id: http://svn.redmine.org/redmine/trunk@16422 e93f8b46-1217-0410-a6f0-8f06a7374b81
2017-03-20 17:17:55 +00:00
Toshi MARUYAMA
79fb434fec Mercurial 4.1 compatibility (#24999)
git-svn-id: http://svn.redmine.org/redmine/trunk@16329 e93f8b46-1217-0410-a6f0-8f06a7374b81
2017-02-05 05:22:29 +00:00
Jean-Philippe Lang
ad0aa40ef1 Autoloading Redmine::Scm::Adapters::CommandFailed might fail.
git-svn-id: http://svn.redmine.org/redmine/trunk@15914 e93f8b46-1217-0410-a6f0-8f06a7374b81
2016-10-20 17:41:16 +00:00
Jean-Philippe Lang
cda9c63d9c Updates copyright for 2016.
git-svn-id: http://svn.redmine.org/redmine/trunk@15238 e93f8b46-1217-0410-a6f0-8f06a7374b81
2016-03-13 10:30:10 +00:00
Jean-Philippe Lang
ad8cfe1887 Newlines stripped from CVS commit messages (#19835).
git-svn-id: http://svn.redmine.org/redmine/trunk@14301 e93f8b46-1217-0410-a6f0-8f06a7374b81
2015-06-13 06:38:26 +00:00
Toshi MARUYAMA
585642d072 scm: git: simplify nil check (#18923)
On Ruby, "if []" is true

git-svn-id: http://svn.redmine.org/redmine/trunk@13931 e93f8b46-1217-0410-a6f0-8f06a7374b81
2015-01-21 12:04:24 +00:00
Toshi MARUYAMA
4dbdff1479 remove trailing white-spaces from lib/redmine/scm/adapters/git_adapter.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@13928 e93f8b46-1217-0410-a6f0-8f06a7374b81
2015-01-21 11:47:28 +00:00
Toshi MARUYAMA
6097e247f4 scm: git: branches return cache too when there is no branch (#18923)
git-svn-id: http://svn.redmine.org/redmine/trunk@13927 e93f8b46-1217-0410-a6f0-8f06a7374b81
2015-01-21 10:58:57 +00:00
Toshi MARUYAMA
64d65b6e27 scm: git: explicitly tags return [] if there is no tag (#18923)
git-svn-id: http://svn.redmine.org/redmine/trunk@13926 e93f8b46-1217-0410-a6f0-8f06a7374b81
2015-01-21 10:58:45 +00:00
Jean-Philippe Lang
9915962356 Make sure that #scm_iconv returns a string with the target encoding (#14534).
filechanges.find_by_revision_and_path fails with SQLite if arguments are not UTF-8 encoded.

git-svn-id: http://svn.redmine.org/redmine/trunk@13902 e93f8b46-1217-0410-a6f0-8f06a7374b81
2015-01-18 16:16:23 +00:00
Jean-Philippe Lang
000124f44f Copyright update.
git-svn-id: http://svn.redmine.org/redmine/trunk@13872 e93f8b46-1217-0410-a6f0-8f06a7374b81
2015-01-11 09:09:50 +00:00
Toshi MARUYAMA
a9298224b1 fix Ruby 2.2 warning at lib/redmine/scm/adapters/cvs_adapter.rb
On ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]:

<pre>
lib/redmine/scm/adapters/cvs_adapter.rb:342:
  warning: Comparable#== will no more rescue exceptions of #<=> in the next release.
lib/redmine/scm/adapters/cvs_adapter.rb:342:
  warning: Return nil in #<=> if the comparison is inappropriate or avoid such comparison.
</pre>

git-svn-id: http://svn.redmine.org/redmine/trunk@13831 e93f8b46-1217-0410-a6f0-8f06a7374b81
2015-01-03 17:31:01 +00:00