Skip to content

Commit c770bef

Browse files
Philip OakleyGit for Windows Build Agent
authored andcommitted
git gui: cope with duplicates in _get_recentrepo
_get_recentrepo will fail if duplicate invalid entries are present in the recentrepo config list. The previous commit fixed the 'git config' limitations in _unset_recentrepo by unsetting all config entries, however this code would fail on the second attempt to unset it. Refactor the code to pre-sort and de-duplicate the recentrepo list to avoid a potential second unset attempt. Signed-off-by: Philip Oakley <[email protected]>
1 parent 1edc9f6 commit c770bef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

git-gui/lib/choose_repository.tcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,14 +235,14 @@ method _invoke_next {} {
235235

236236
proc _get_recentrepos {} {
237237
set recent [list]
238-
foreach p [get_config gui.recentrepo] {
238+
foreach p [lsort -unique [get_config gui.recentrepo]] {
239239
if {[_is_git [file join $p .git]]} {
240240
lappend recent $p
241241
} else {
242242
_unset_recentrepo $p
243243
}
244244
}
245-
return [lsort $recent]
245+
return $recent
246246
}
247247

248248
proc _unset_recentrepo {p} {

0 commit comments

Comments
 (0)