diff options
author | Alberto Bertogli <albertito@blitiri.com.ar> | 2014-12-31 18:01:28 +0100 |
---|---|---|
committer | Alberto Bertogli <albertito@blitiri.com.ar> | 2014-12-31 18:07:38 +0100 |
commit | df00293a7cd6e3fb11d0c1bf2fbf1c3ad485824c (patch) | |
tree | cb440b653c2b7481ffceafc7603071b4ba530ae4 /git-arr | |
parent | 7898b2becdc9ad35b0d853bc5d46be24a05a6a48 (diff) | |
download | git-arr-fork-df00293a7cd6e3fb11d0c1bf2fbf1c3ad485824c.zip |
git: Add '--' to "git rev-list" runs to avoid ambiguous arguments
If there is a branch and a file with the same name, git-arr will fail to
generate, as git will complain when running git rev-list.
For example, if there is both a file and a branch called "hooks" in the
repository, git-arr would fail as follows:
=== git-arr running: ['git', '--git-dir=/some/repo', 'rev-list', '--max-count=1', '--header', u'hooks'])
fatal: ambiguous argument 'hooks': both revision and filename
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Traceback (most recent call last):
File "./git-arr", line 457, in <module>
main()
File "./git-arr", line 452, in main
skip_index = len(opts.only) > 0)
File "./git-arr", line 388, in generate
branch_mtime = r.commit(bn).committer_date.epoch
AttributeError: 'NoneType' object has no attribute 'committer_date'
To fix that, this patch appends a "--" as the last argument to rev-list, which
indicates that it has completed the revision list, which disambiguates the
argument.
While at it, a minor typo in a comment is also fixed.
Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>
Diffstat (limited to 'git-arr')
-rwxr-xr-x | git-arr | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -380,7 +380,7 @@ def generate(output, skip_index = False): # To avoid regenerating files that have not changed, we will # instruct write_to() to set their mtime to the branch's committer - # date, and then compare against it to decide wether or not to + # date, and then compare against it to decide whether or not to # write. branch_mtime = r.commit(bn).committer_date.epoch |