Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 353255 - Fetch factory does not checkout tag/branch after initial clone of repo
Summary: Fetch factory does not checkout tag/branch after initial clone of repo
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: Core (show other bugs)
Version: 0.12   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-27 17:04 EDT by Andrew Niefer CLA
Modified: 2011-07-28 14:43 EDT (History)
6 users (show)

See Also:


Attachments
log file (8.03 KB, text/plain)
2011-07-27 17:04 EDT, Andrew Niefer CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Niefer CLA 2011-07-27 17:04:57 EDT
Created attachment 200477 [details]
log file

When running the fetch factory to get code from a repository for the first time (ie, the repo has not been previously cloned for the build), then the appropriate tag/branch does not get checked out, the repo remains on master as a default.  This is a problem when building for a branch.

The cause is that the checkout task "GitCheckoutTagInLocalRepo" is conditional on a property indicating the existance of the clone.
Things go like this:
1) check for repo & set property if it exists
2) if property is set (repo exists) update the repo
3) if property is not set (repo does not exist), clone the repo
4) if property is set, checkout tag 
5) re-check for repo existance and set property
6) if property is set, copy code


At step 4 we do not do the checkout because the property is still not set.
We should be rechecking repo existance and setting the property before trying to checkout a tag.

See attached log file for this in action
Comment 1 Andrew Niefer CLA 2011-07-27 17:20:37 EDT
http://egit.eclipse.org/r/3934
Comment 2 Andrew Niefer CLA 2011-07-28 14:43:59 EDT
The patch referred to in comment #1 was merged in by Gunnar.
I gave Kim a jar with these changes and she is running with them.

I'm marking this fixed, but I'm not sure what target milestone to put on it since I don't know where egit is with their releases.