Fix computing of the package name from the git repo

Use replace() instead of rstrip() to properly remove the .git extension.

Change-Id: Ia3d0d94415be554ddc3b66313660cea92b1488a5