Edgewall Software
Modify

Opened 8 years ago

Closed 8 years ago

#12758 closed defect (fixed)

repository sync failing with cached git repository which has a file started with colon character

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Milestone: 1.0.14
Component: plugin/git Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:

Fix IndexError raised from diff_tree() raised when git repository has a file started with a colon character.

API Changes:
Internal Changes:

Description

This issue is initially reported in gdiscussion:trac-users:FnOqc5nUlWg.

$ cd /var/git/testing.git
$ git log --name-status
commit baa7ee95a075cfd0a4de55bc4fe2ed599ed19109
Author: Jun Omae <jun66j5@gmail.com>
Date:   Wed Apr 5 19:13:02 2017 +0900

    testing...

A       0-file.txt
A       :-file.txt
A       a-file.txt

$ /venv/trac/1.0.13/bin/trac-admin /var/trac/1.0-sqlite
Trac [/var/trac/1.0-sqlite]> repository add '' /var/git/testing.git git
...
Trac [/var/trac/1.0-sqlite]> repository sync ''
...
2017-04-05 19:24:15,746 Trac[util] DEBUG: prefetch: 0 rows
IndexError: list index out of range
2017-04-05 19:24:15,747 Trac[console] ERROR: Exception in trac-admin command: u"repository sync ''"
Traceback (most recent call last):
  File "/venv/trac/1.0.13/lib/python2.5/site-packages/trac/admin/console.py", line 110, in onecmd
    rv = cmd.Cmd.onecmd(self, line) or 0
  File "/usr/lib/python2.5/cmd.py", line 218, in onecmd
    return self.default(line)
  File "/venv/trac/1.0.13/lib/python2.5/site-packages/trac/admin/console.py", line 289, in default
    return self.cmd_mgr.execute_command(*args)
  File "/venv/trac/1.0.13/lib/python2.5/site-packages/trac/admin/api.py", line 127, in execute_command
    return f(*fargs)
  File "/venv/trac/1.0.13/lib/python2.5/site-packages/trac/versioncontrol/admin.py", line 159, in _do_sync
    self._sync(reponame, rev, clean=False)
  File "/venv/trac/1.0.13/lib/python2.5/site-packages/trac/versioncontrol/admin.py", line 143, in _sync
    repos.sync(self._sync_feedback, clean=clean)
  File "/venv/trac/1.0.13/lib/python2.5/site-packages/tracopt/versioncontrol/git/git_fs.py", line 141, in sync
    self._insert_changeset(db, rev, cset)
  File "/venv/trac/1.0.13/lib/python2.5/site-packages/trac/versioncontrol/cache.py", line 285, in _insert_changeset
    for path, kind, action, bpath, brev in cset.get_changes():
  File "/venv/trac/1.0.13/lib/python2.5/site-packages/tracopt/versioncontrol/git/git_fs.py", line 852, in get_changes
    self.repos.git.diff_tree(parent, self.rev, find_renames=True):
  File "/venv/trac/1.0.13/lib/python2.5/site-packages/tracopt/versioncontrol/git/PyGIT.py", line 1054, in diff_tree
    yield __chg_tuple()
  File "/venv/trac/1.0.13/lib/python2.5/site-packages/tracopt/versioncontrol/git/PyGIT.py", line 1045, in __chg_tuple
    chg[6] = self._fs_to_unicode(chg[6])
IndexError: list index out of range

Attachments (0)

Change History (2)

comment:1 by Jun Omae, 8 years ago

Owner: set to Jun Omae
Status: newassigned

Proposed changes in [92f7469f1/jomae.git] (jomae.git@t12758+1.0).

For 1.2-stable, the changes will be merged after replacing iterate.next() with next(iterate).

Last edited 8 years ago by Jun Omae (previous) (diff)

comment:2 by Jun Omae, 8 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Fixed in [15759] and merged in [15760-15761].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jun Omae to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.