Skip to content

Commit b7986ce

Browse files
author
Junio C Hamano
committed
Merge branch 'master' into next
* master: Makefile: Add TAGS and tags targets ls-files: Don't require exclude files to end with a newline.
2 parents 2fc2752 + f81e7c6 commit b7986ce

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

Makefile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,13 @@ $(LIB_FILE): $(LIB_OBJS)
553553
doc:
554554
$(MAKE) -C Documentation all
555555

556+
TAGS:
557+
rm -f TAGS
558+
find . -name '*.[hcS]' -print | xargs etags -a
559+
560+
tags:
561+
rm -f tags
562+
find . -name '*.[hcS]' -print | xargs ctags -a
556563

557564
### Testing rules
558565

@@ -617,7 +624,7 @@ rpm: dist
617624
clean:
618625
rm -f *.o mozilla-sha1/*.o arm/*.o ppc/*.o compat/*.o $(LIB_FILE)
619626
rm -f $(ALL_PROGRAMS) git$X
620-
rm -f *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h
627+
rm -f *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags
621628
rm -rf $(GIT_TARNAME)
622629
rm -f $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
623630
$(MAKE) -C Documentation/ clean
@@ -626,5 +633,5 @@ clean:
626633
rm -f GIT-VERSION-FILE
627634

628635
.PHONY: all install clean strip
629-
.PHONY: .FORCE-GIT-VERSION-FILE
636+
.PHONY: .FORCE-GIT-VERSION-FILE TAGS tags
630637

ls-files.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,12 @@ static int add_excludes_from_file_1(const char *fname,
9393
close(fd);
9494
return 0;
9595
}
96-
buf = xmalloc(size);
96+
buf = xmalloc(size+1);
9797
if (read(fd, buf, size) != size)
9898
goto err;
9999
close(fd);
100100

101+
buf[size++] = '\n';
101102
entry = buf;
102103
for (i = 0; i < size; i++) {
103104
if (buf[i] == '\n') {

0 commit comments

Comments
 (0)