Remove `inmem` flag, use NULL name instead
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
diff --git a/src/remote.c b/src/remote.c
index a2e6e68..29734cc 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -191,7 +191,6 @@ int git_remote_create_inmemory(git_remote **out, git_repository *repo, const cha
if ((error = create_internal(&remote, repo, NULL, url, fetch)) < 0)
return error;
- remote->inmem = true;
*out = remote;
return 0;
}
@@ -366,7 +365,7 @@ int git_remote_save(const git_remote *remote)
assert(remote);
- if (remote->inmem) {
+ if (!remote->name) {
giterr_set(GITERR_INVALID, "Can't save an in-memory remote.");
return GIT_EINVALIDSPEC;
}
@@ -1325,7 +1324,7 @@ int git_remote_rename(
assert(remote && new_name);
- if (remote->inmem) {
+ if (!remote->name) {
giterr_set(GITERR_INVALID, "Can't rename an in-memory remote.");
return GIT_EINVALIDSPEC;
}
@@ -1347,7 +1346,7 @@ int git_remote_rename(
remote->name = git__strdup(new_name);
- if (remote->inmem) return 0;
+ if (!remote->name) return 0;
return git_remote_save(remote);
}
diff --git a/src/remote.h b/src/remote.h
index 1cf9eef..8d39244 100644
--- a/src/remote.h
+++ b/src/remote.h
@@ -19,7 +19,6 @@ struct git_remote {
char *name;
char *url;
char *pushurl;
- bool inmem;
git_vector refs;
struct git_refspec fetch;
struct git_refspec push;