Skip to content

Commit c63da8d

Browse files
author
Junio C Hamano
committed
GIT 1.0.3
Signed-off-by: Junio C Hamano <junkio@cox.net>
2 parents 8d712aa + 1e80e04 commit c63da8d

File tree

9 files changed

+44
-31
lines changed

9 files changed

+44
-31
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ all:
5555
# Define USE_STDEV below if you want git to care about the underlying device
5656
# change being considered an inode change from the update-cache perspective.
5757

58-
GIT_VERSION = 1.0.0b
58+
GIT_VERSION = 1.0.3
5959

6060
# CFLAGS and LDFLAGS are for the users to override from the command line.
6161

@@ -397,6 +397,9 @@ $(patsubst %.py,%,$(SCRIPT_PYTHON)) : % : %.py
397397
git-cherry-pick: git-revert
398398
cp $< $@
399399

400+
# format-patch records GIT_VERSION
401+
git-format-patch: Makefile
402+
400403
%.o: %.c
401404
$(CC) -o $*.o -c $(ALL_CFLAGS) $<
402405
%.o: %.S

config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ int git_config_set_multivar(const char* key, const char* value,
487487
store.value_regex = (regex_t*)malloc(sizeof(regex_t));
488488
if (regcomp(store.value_regex, value_regex,
489489
REG_EXTENDED)) {
490-
fprintf(stderr, "Invalid pattern: %s",
490+
fprintf(stderr, "Invalid pattern: %s\n",
491491
value_regex);
492492
free(store.value_regex);
493493
return 6;

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
git-core (1.0.3-0) unstable; urgency=low
2+
3+
* GIT 1.0.3 maintenance release.
4+
5+
-- Junio C Hamano <junkio@cox.net> Thu, 22 Dec 2005 18:13:33 -0800
6+
17
git-core (1.0.0b-0) unstable; urgency=low
28

39
* GIT 1.0.0b to include two more fixes.

git.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ int main(int argc, char **argv, char **envp)
278278
if (*exec_path != '/') {
279279
if (!getcwd(git_command, sizeof(git_command))) {
280280
fprintf(stderr,
281-
"git: cannot determine current directory");
281+
"git: cannot determine current directory\n");
282282
exit(1);
283283
}
284284
len = strlen(git_command);

http-fetch.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,8 @@ static void process_object_response(void *callback_data)
267267
obj_req->state = COMPLETE;
268268

269269
/* Use alternates if necessary */
270-
if (obj_req->http_code == 404) {
270+
if (obj_req->http_code == 404 ||
271+
obj_req->curl_result == CURLE_FILE_COULDNT_READ_FILE) {
271272
fetch_alternates(alt->base);
272273
if (obj_req->repo->next != NULL) {
273274
obj_req->repo =
@@ -475,7 +476,8 @@ static void process_alternates_response(void *callback_data)
475476
}
476477
}
477478
} else if (slot->curl_result != CURLE_OK) {
478-
if (slot->http_code != 404) {
479+
if (slot->http_code != 404 &&
480+
slot->curl_result != CURLE_FILE_COULDNT_READ_FILE) {
479481
got_alternates = -1;
480482
return;
481483
}
@@ -637,7 +639,8 @@ static int fetch_indices(struct alt_base *repo)
637639
if (start_active_slot(slot)) {
638640
run_active_slot(slot);
639641
if (slot->curl_result != CURLE_OK) {
640-
if (slot->http_code == 404) {
642+
if (slot->http_code == 404 ||
643+
slot->curl_result == CURLE_FILE_COULDNT_READ_FILE) {
641644
repo->got_indices = 1;
642645
free(buffer.buffer);
643646
return 0;
@@ -802,7 +805,8 @@ static int fetch_object(struct alt_base *repo, unsigned char *sha1)
802805
ret = error("Request for %s aborted", hex);
803806
} else if (obj_req->curl_result != CURLE_OK &&
804807
obj_req->http_code != 416) {
805-
if (obj_req->http_code == 404)
808+
if (obj_req->http_code == 404 ||
809+
obj_req->curl_result == CURLE_FILE_COULDNT_READ_FILE)
806810
ret = -1; /* Be silent, it is probably in a pack. */
807811
else
808812
ret = error("%s (curl_result = %d, http_code = %ld, sha1 = %s)",

receive-pack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ static int run_update_hook(const char *refname,
7979
case -ERR_RUN_COMMAND_WAITPID_WRONG_PID:
8080
die("waitpid is confused");
8181
case -ERR_RUN_COMMAND_WAITPID_SIGNAL:
82-
fprintf(stderr, "%s died of signal", update_hook);
82+
fprintf(stderr, "%s died of signal\n", update_hook);
8383
return -1;
8484
case -ERR_RUN_COMMAND_WAITPID_NOEXIT:
8585
die("%s died strangely", update_hook);

send-pack.c

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -231,23 +231,21 @@ static int send_pack(int in, int out, int nr_refspec, char **refspec)
231231
if (!force_update &&
232232
!is_zero_sha1(ref->old_sha1) &&
233233
!ref->force) {
234-
if (!has_sha1_file(ref->old_sha1)) {
235-
error("remote '%s' object %s does not "
236-
"exist on local",
237-
ref->name, sha1_to_hex(ref->old_sha1));
238-
ret = -2;
239-
continue;
240-
}
241-
242-
/* We assume that local is fsck-clean. Otherwise
243-
* you _could_ have an old tag which points at
244-
* something you do not have, which may or may not
245-
* be a commit.
246-
*/
247-
if (!ref_newer(ref->peer_ref->new_sha1,
234+
if (!has_sha1_file(ref->old_sha1) ||
235+
!ref_newer(ref->peer_ref->new_sha1,
248236
ref->old_sha1)) {
249-
error("remote ref '%s' is not a strict "
250-
"subset of local ref '%s'.", ref->name,
237+
/* We do not have the remote ref, or
238+
* we know that the remote ref is not
239+
* an ancestor of what we are trying to
240+
* push. Either way this can be losing
241+
* commits at the remote end and likely
242+
* we were not up to date to begin with.
243+
*/
244+
error("remote '%s' is not a strict "
245+
"subset of local ref '%s'. "
246+
"maybe you are not up-to-date and "
247+
"need to pull first?",
248+
ref->name,
251249
ref->peer_ref->name);
252250
ret = -2;
253251
continue;

sha1_file.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ char * sha1_to_hex(const unsigned char *sha1)
8181
*buf++ = hex[val >> 4];
8282
*buf++ = hex[val & 0xf];
8383
}
84+
*buf = '\0';
85+
8486
return buffer;
8587
}
8688

@@ -464,7 +466,7 @@ struct packed_git *add_packed_git(char *path, int path_len, int local)
464466
p->pack_last_used = 0;
465467
p->pack_use_cnt = 0;
466468
p->pack_local = local;
467-
if (!get_sha1_hex(path + path_len - 40 - 4, sha1))
469+
if ((path_len > 44) && !get_sha1_hex(path + path_len - 44, sha1))
468470
memcpy(p->sha1, sha1, 20);
469471
return p;
470472
}
@@ -1274,7 +1276,7 @@ int move_temp_to_file(const char *tmpfile, char *filename)
12741276
unlink(tmpfile);
12751277
if (ret) {
12761278
if (ret != EEXIST) {
1277-
fprintf(stderr, "unable to write sha1 filename %s: %s", filename, strerror(ret));
1279+
fprintf(stderr, "unable to write sha1 filename %s: %s\n", filename, strerror(ret));
12781280
return -1;
12791281
}
12801282
/* FIXME!!! Collision check here ? */
@@ -1313,15 +1315,15 @@ int write_sha1_file(void *buf, unsigned long len, const char *type, unsigned cha
13131315
}
13141316

13151317
if (errno != ENOENT) {
1316-
fprintf(stderr, "sha1 file %s: %s", filename, strerror(errno));
1318+
fprintf(stderr, "sha1 file %s: %s\n", filename, strerror(errno));
13171319
return -1;
13181320
}
13191321

13201322
snprintf(tmpfile, sizeof(tmpfile), "%s/obj_XXXXXX", get_object_directory());
13211323

13221324
fd = mkstemp(tmpfile);
13231325
if (fd < 0) {
1324-
fprintf(stderr, "unable to create temporary sha1 filename %s: %s", tmpfile, strerror(errno));
1326+
fprintf(stderr, "unable to create temporary sha1 filename %s: %s\n", tmpfile, strerror(errno));
13251327
return -1;
13261328
}
13271329

@@ -1410,7 +1412,7 @@ int write_sha1_to_fd(int fd, const unsigned char *sha1)
14101412
size = write(fd, buf + posn, objsize - posn);
14111413
if (size <= 0) {
14121414
if (!size) {
1413-
fprintf(stderr, "write closed");
1415+
fprintf(stderr, "write closed\n");
14141416
} else {
14151417
perror("write ");
14161418
}

show-branch.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ static int append_ref(const char *refname, const unsigned char *sha1)
303303
return 0;
304304
if (MAX_REVS <= ref_name_cnt) {
305305
fprintf(stderr, "warning: ignoring %s; "
306-
"cannot handle more than %d refs",
306+
"cannot handle more than %d refs\n",
307307
refname, MAX_REVS);
308308
return 0;
309309
}
@@ -537,7 +537,7 @@ int main(int ac, char **av)
537537
if (MAX_REVS <= num_rev)
538538
die("cannot handle more than %d revs.", MAX_REVS);
539539
if (get_sha1(ref_name[num_rev], revkey))
540-
die("'%s' is not a valid ref.\n", ref_name[num_rev]);
540+
die("'%s' is not a valid ref.", ref_name[num_rev]);
541541
commit = lookup_commit_reference(revkey);
542542
if (!commit)
543543
die("cannot find commit %s (%s)",

0 commit comments

Comments
 (0)