fetch.c: remove an unused variable and dead code.
Funnily enough, this variable was never assigned ever since it was introduced, and has been protecting some code that has never been executed. Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
May 24, 2006 at 16:42 UTC
84c667ff97da2a3864ef7952b9f438d133ce35ef
2 files changed
+3
-20
fetch.c
+3
-17
@@ -9,8 +9,6 @@
9
10
const char *write_ref = NULL;
11
12
-const unsigned char *current_ref = NULL;
13
-
12
int get_tree = 0;
13
int get_history = 0;
14
int get_all = 0;
@@ -205,19 +203,12 @@ static int mark_complete(const char *path, const unsigned char *sha1)
203
int pull(char *target)
204
{
205
unsigned char sha1[20];
208
- int fd = -1;
206
207
save_commit_buffer = 0;
208
track_object_refs = 0;
212
- if (write_ref && current_ref) {
213
- fd = lock_ref_sha1(write_ref, current_ref);
214
- if (fd < 0)
215
- return -1;
216
- }
209
218
- if (!get_recover) {
210
+ if (!get_recover)
211
for_each_ref(mark_complete);
220
- }
212
213
if (interpret_target(target, sha1))
214
return error("Could not interpret %s as something to pull",
@@ -227,12 +218,7 @@ int pull(char *target)
218
if (loop())
219
return -1;
220
230
- if (write_ref) {
231
- if (current_ref) {
232
- write_ref_sha1(write_ref, fd, sha1);
233
- } else {
234
- write_ref_sha1_unlocked(write_ref, sha1);
235
- }
236
- }
221
+ if (write_ref)
222
+ write_ref_sha1_unlocked(write_ref, sha1);
223
return 0;
224
}
fetch.h
-3
@@ -25,9 +25,6 @@ extern int fetch_ref(char *ref, unsigned char *sha1);
25
/* If set, the ref filename to write the target value to. */
26
extern const char *write_ref;
27
28
-/* If set, the hash that the current value of write_ref must be. */
29
-extern const unsigned char *current_ref;
30
-
28
/* Set to fetch the target tree. */
29
extern int get_tree;
30