Browse Source

[PATCH] Rename confusing variable in show-diff

The show-diff command uses a variable "new" but it is always
used to point at the original data recorded in the dircache
before the user started editing in the working file.  Rename it
to "old" to avoid confusion.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
maint
Junio C Hamano 20 years ago committed by Linus Torvalds
parent
commit
b70c8942d3
  1. 8
      show-diff.c

8
show-diff.c

@ -162,7 +162,7 @@ int main(int argc, char **argv) @@ -162,7 +162,7 @@ int main(int argc, char **argv)
int changed;
unsigned long size;
char type[20];
void *new;
void *old;

if (1 <argc &&
! matches_pathspec(ce, argv+1, argc-1))
@ -193,9 +193,9 @@ int main(int argc, char **argv) @@ -193,9 +193,9 @@ int main(int argc, char **argv)
if (silent)
continue;

new = read_sha1_file(ce->sha1, type, &size);
show_differences(ce->name, new, size);
free(new);
old = read_sha1_file(ce->sha1, type, &size);
show_differences(ce->name, old, size);
free(old);
}
return 0;
}
Loading…
Cancel
Save