Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ static int create_internal(git_remote **out, git_repository *repo, const char *n
goto on_error;

/* only write for non-anonymous remotes */
if (name && (error = write_add_refspec(repo, name, fetch, true)) < 0)
if (repo && name && (error = write_add_refspec(repo, name, fetch, true)) < 0)
goto on_error;

if (repo && (error = lookup_remote_prune_config(remote, config_ro, name)) < 0)
Expand Down
4 changes: 3 additions & 1 deletion src/transports/local.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,10 @@ static int foreach_reference_cb(git_reference *reference, void *payload)
git_revwalk *walk = (git_revwalk *)payload;
int error;

if (git_reference_type(reference) != GIT_REF_OID)
if (git_reference_type(reference) != GIT_REF_OID) {
git_reference_free(reference);
return 0;
}

error = git_revwalk_hide(walk, git_reference_target(reference));
/* The reference is in the local repository, so the target may not
Expand Down
2 changes: 1 addition & 1 deletion src/worktree.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ static int open_worktree_dir(git_worktree **out, const char *parent, const char
goto out;
}

if ((wt = git__calloc(1, sizeof(struct git_repository))) == NULL) {
if ((wt = git__calloc(1, sizeof(*wt))) == NULL) {
error = -1;
goto out;
}
Expand Down