format-code: Fix formatting failures

There's a lengthy comment in the custom script as to why it needs to
exist, and given it does, make it work.

At some point the build scripts started passing the directory whose code
should be formatted as the first argument to format-code.sh[1].

When format-code.sh is invoked, the working directory remains the
workspace directory, so make our custom script change into the repo in
order for the git commands to work.

[1] https://github.com/openbmc/openbmc-build-scripts/blob/cd9578b262fcce6f1e4e3f76fa05fa5f56100123/scripts/unit-test.py#L1221

Change-Id: I34cb9dacb0270afadab0b8f138df80446bce63a2
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
diff --git a/format-code.sh b/format-code.sh
index 0f67180..1eb2232 100755
--- a/format-code.sh
+++ b/format-code.sh
@@ -4,6 +4,11 @@
 
 set -x
 
+if [ $# -ge 1 ]
+then
+    cd "$1"
+fi
+
 [ -f .clang-format ] && rm .clang-format
 
 # Use the provided clang-format, only define a version