From dea5d6f8cbd86916ec5373fb704c67e1a33e29a8 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Mon, 16 Sep 2013 14:52:01 +0000 Subject: foreach: sort repositories asciibetically The test suite checks the output of the foreach command, this requires repositories to be returned in a stable order. The order returned from os.listdir differs by the filesystem used. btrfs returns roughly in insertion order, tmpfs alphabetically. This allowed the failure to sort pass through unchecked, since I was testing on btrfs, but people discovered issues when using /tmp, which is a tmpfs. To fix this, foreach sorts the result of list_git_directories() by directory name. The previous code would always return the root repository first, this was a unnecessary complication, so now everything is returned asciibetically and the tests amended to reflect this. --- .../edit-checkouts-existing-chunk.stdout | 6 +++--- tests.branching/edit-clones-chunk.stdout | 24 +++++++++++----------- .../foreach-handles-command-failure.stderr | 2 +- .../foreach-handles-command-failure.stdout | 2 +- 4 files changed, 17 insertions(+), 17 deletions(-) (limited to 'tests.branching') diff --git a/tests.branching/edit-checkouts-existing-chunk.stdout b/tests.branching/edit-checkouts-existing-chunk.stdout index 5fbea686..f6ac79c2 100644 --- a/tests.branching/edit-checkouts-existing-chunk.stdout +++ b/tests.branching/edit-checkouts-existing-chunk.stdout @@ -1,11 +1,11 @@ Current branches: -test:morphs -* alfred - test:hello * alfred master +test:morphs +* alfred + Files in hello: hello.morph diff --git a/tests.branching/edit-clones-chunk.stdout b/tests.branching/edit-clones-chunk.stdout index dd3f00ef..d0bcb565 100644 --- a/tests.branching/edit-clones-chunk.stdout +++ b/tests.branching/edit-clones-chunk.stdout @@ -1,19 +1,21 @@ Current branches: -test:morphs +test:hello master * newbranch -test:hello +test:morphs master * newbranch Current origins: -test:morphs +test:hello * remote origin - Fetch URL: file://TMP/morphs - Push URL: file://TMP/morphs - HEAD branch: master + Fetch URL: file://TMP/hello + Push URL: file://TMP/hello + HEAD branch (remote HEAD is ambiguous, may be one of the following): + alfred + master Remote branches: alfred tracked master tracked @@ -22,13 +24,11 @@ test:morphs Local ref configured for 'git push': master pushes to master (up to date) -test:hello +test:morphs * remote origin - Fetch URL: file://TMP/hello - Push URL: file://TMP/hello - HEAD branch (remote HEAD is ambiguous, may be one of the following): - alfred - master + Fetch URL: file://TMP/morphs + Push URL: file://TMP/morphs + HEAD branch: master Remote branches: alfred tracked master tracked diff --git a/tests.branching/foreach-handles-command-failure.stderr b/tests.branching/foreach-handles-command-failure.stderr index c3085343..c7b8316b 100644 --- a/tests.branching/foreach-handles-command-failure.stderr +++ b/tests.branching/foreach-handles-command-failure.stderr @@ -1 +1 @@ -ERROR: Command failed at repo test:morphs: git remote update non-existant-remote +ERROR: Command failed at repo test:hello: git remote update non-existant-remote diff --git a/tests.branching/foreach-handles-command-failure.stdout b/tests.branching/foreach-handles-command-failure.stdout index 6bb791b3..d687996d 100644 --- a/tests.branching/foreach-handles-command-failure.stdout +++ b/tests.branching/foreach-handles-command-failure.stdout @@ -1,2 +1,2 @@ -test:morphs +test:hello fatal: No such remote or remote group: non-existant-remote -- cgit v1.2.1