Fetching entire repo, not just single commit

We have two somewhat complex build script running on TeamCity, both of which involves some git trickery where we have resorted to some hacks to deal with how TC checks out the code. One of the scripts does a simple optimizations to trim down the build time. It basically runs  `git diff --name-only origin/master...HEAD` and checks if some of the changed files in the PR matches a directory containing gui components, and if not, it skips the gui testing.

Trouble is: this does not work out of the box in TC, because it somehow manages to create a Git repository with a single commit. It does not know of any of the branches in `origin`, so it cannot resolve the reference `origin/master`. To fix this, we have had to add a `git fetch origin master` step in our script, which has all its own warts (needing to handle authentication ourselves, using credential helpers and whatnot), and I think there should be some way of configuring TC not to do these "slim" checkouts, but I have not found it so far.

The other script is given a commit and a tag name and is supposed to tag the commit after creating an artifact, but it has the same problem: the commit is only known if it exists in the default branch for the VCS config, not in any other branch. This again is solved by doing `git fetch origin`.

0

Please sign in to leave a comment.