summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fetch.c4
-rw-r--r--src/stash.c9
-rw-r--r--src/transports/smart_protocol.c4
-rw-r--r--src/transports/ssh.c3
4 files changed, 16 insertions, 4 deletions
diff --git a/src/fetch.c b/src/fetch.c
index 5bf2b93c1..c7d2c83a1 100644
--- a/src/fetch.c
+++ b/src/fetch.c
@@ -42,8 +42,10 @@ static int maybe_want(git_remote *remote, git_remote_head *head, git_odb *odb, g
return 0;
/* If we have the object, mark it so we don't ask for it */
- if (git_odb_exists(odb, &head->oid))
+ if (git_odb_exists(odb, &head->oid)) {
head->local = 1;
+ remote->need_pack = 0;
+ }
else
remote->need_pack = 1;
diff --git a/src/stash.c b/src/stash.c
index b1dd87b22..0c9101294 100644
--- a/src/stash.c
+++ b/src/stash.c
@@ -465,7 +465,8 @@ static int ensure_there_are_changes_to_stash(
static int reset_index_and_workdir(
git_repository *repo,
git_commit *commit,
- bool remove_untracked)
+ bool remove_untracked,
+ bool remove_ignored)
{
git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT;
@@ -474,6 +475,9 @@ static int reset_index_and_workdir(
if (remove_untracked)
opts.checkout_strategy |= GIT_CHECKOUT_REMOVE_UNTRACKED;
+ if (remove_ignored)
+ opts.checkout_strategy |= GIT_CHECKOUT_REMOVE_IGNORED;
+
return git_checkout_tree(repo, (git_object *)commit, &opts);
}
@@ -532,7 +536,8 @@ int git_stash_save(
if ((error = reset_index_and_workdir(
repo,
((flags & GIT_STASH_KEEP_INDEX) != 0) ? i_commit : b_commit,
- (flags & GIT_STASH_INCLUDE_UNTRACKED) != 0)) < 0)
+ (flags & GIT_STASH_INCLUDE_UNTRACKED) != 0,
+ (flags & GIT_STASH_INCLUDE_IGNORED) != 0)) < 0)
goto cleanup;
cleanup:
diff --git a/src/transports/smart_protocol.c b/src/transports/smart_protocol.c
index dd9b5e0ed..7e8fcdd92 100644
--- a/src/transports/smart_protocol.c
+++ b/src/transports/smart_protocol.c
@@ -579,6 +579,10 @@ int git_smart__download_pack(
done:
if (writepack)
writepack->free(writepack);
+ if (progress_cb) {
+ t->packetsize_cb = NULL;
+ t->packetsize_payload = NULL;
+ }
return error;
}
diff --git a/src/transports/ssh.c b/src/transports/ssh.c
index 37f17080a..bece0b45d 100644
--- a/src/transports/ssh.c
+++ b/src/transports/ssh.c
@@ -53,6 +53,7 @@ static void ssh_error(LIBSSH2_SESSION *session, const char *errmsg)
static int gen_proto(git_buf *request, const char *cmd, const char *url)
{
char *repo;
+ int len;
if (!git__prefixcmp(url, prefix_ssh)) {
url = url + strlen(prefix_ssh);
@@ -67,7 +68,7 @@ static int gen_proto(git_buf *request, const char *cmd, const char *url)
return -1;
}
- int len = strlen(cmd) + 1 /* Space */ + 1 /* Quote */ + strlen(repo) + 1 /* Quote */ + 1;
+ len = strlen(cmd) + 1 /* Space */ + 1 /* Quote */ + strlen(repo) + 1 /* Quote */ + 1;
git_buf_grow(request, len);
git_buf_printf(request, "%s '%s'", cmd, repo);