Conversation
Signed-off-by: Shubham Ghule <[email protected]>
Signed-off-by: Shubham Ghule <[email protected]>
…repository Signed-off-by: Shubham Ghule <[email protected]>
dscho
left a comment
There was a problem hiding this comment.
These changes should probably all be consolidated into a single patch.
Please have a look at other commits touching e.g. repository.c for inspiration with the commit message: the Git project strongly prefers verbose commit messages, in the imperative tense instead of the past tense.
Finally, I see that there are merge conflicts. Please rebase the changes on top of the target branch.
| struct repository | ||
| { | ||
| int fetch_if_missing; | ||
| }repo; |
There was a problem hiding this comment.
In this header, this is just a forward declaration of struct repository. The actual struct is defined in repository.h. You probably want to add the field there.
| if (!strcmp(arg, "allow-any")) { | ||
| arg_missing_action = MA_ALLOW_ANY; | ||
| fetch_if_missing = 0; | ||
| repo.fetch_if_missing = 0; |
There was a problem hiding this comment.
At this point, there is no variable repo. The variable you are looking for is probably the_repository, and as it is a pointed, you need to use -> rather than . to dereference it.
| { | ||
| struct remote *remote; | ||
| struct transport *transport; | ||
| int original_fetch_if_missing = fetch_if_missing; |
There was a problem hiding this comment.
This line also needs to be adjusted.
| } else if (opt && opt->allow_exclude_promisor_objects && | ||
| !strcmp(arg, "--exclude-promisor-objects")) { | ||
| if (fetch_if_missing) | ||
| if (repo.fetch_if_missing) |
There was a problem hiding this comment.
IIRC struct rev_info contains a pointer to the repository in question. repo does not exist at this point.
| int original_fetch_if_missing = fetch_if_missing; | ||
|
|
||
| fetch_if_missing = 0; | ||
| repo.fetch_if_missing = 0; |
There was a problem hiding this comment.
You will need to adjust the signature of fetch_refs() to receive a pointer to the repository, the convention is to use struct repository *r.
| } | ||
|
|
||
| int fetch_if_missing = 1; | ||
| repo.fetch_if_missing = 1; |
There was a problem hiding this comment.
That is not the correct spot to initialize default values of structs. The correct spot is repo_init() in repository.c.
|
|
||
| /* Check if it is a missing object */ | ||
| if (fetch_if_missing && repository_format_partial_clone && | ||
| if (repo.fetch_if_missing && repository_format_partial_clone && |
There was a problem hiding this comment.
This function already accepts a parameter r of type struct repository *, please use that instead of the non-existing repo variable.
|
@dev-shubham1 gentle ping? |
Hi GIT contributors !
I am Shubham Ghule.I have resolved the problem of extern integer fetch_if_missing by putting it in the structure repository as a field.I have achieved this by declaring an object named repo of structure repository and including alloc.h file where fetch_if_missing was used.
I'm looking forward to your review.
Special thanks to @dscho.
with regards,
Shubham.