When you have a git branch other than master checked out, build-webkit places the build products in WebKit/WebKitBuild/<branch-name>. However, it doesn't respect any default configuration that is set via WebKit/WebKitTools/Scripts/set-webkit-configuration. For example, I use WebKit/WebKitTools/Scripts/set-webkit-configuration --debug, but build-webkit builds Release rather than Debug for my git branch. The configuration file containing "Debug" is located at WebKit/WebKitBuild/Configuration. If I run WebKit/WebKitTools/Scripts/set-webkit-configuration --debug with a non-master git branch, it still writes the Configuration file at that same location rather than to WebKit/WebKitBuild/<branch-name>/Configuration. Ideally, in my opinion, build-webkit would just respect the setting in the file WebKit/WebKitBuild/Configuration. However, it would also be acceptable to fix this bug by modifying set-webkit-configuration to write the Configuration file to the branch build location, and have build-webkit respect that.
To be clear, this is only an issue if you enable the non-default options of core.webKitBranchBuild or branch.$branch.webKitBranchBuild in your git configuration.
That's correct. I had forgotten that wasn't the default behavior, thanks.
For the underlying cause of this bug, see https://bugs.webkit.org/show_bug.cgi?id=40207 VCSUtils.pm functions return wrong value when current dir is not in WebKit