Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
ls-files: convert show_ce_entry to take an index
author
Brandon Williams
<bmwill@google.com>
Mon, 12 Jun 2017 22:14:05 +0000
(15:14 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 13 Jun 2017 18:40:51 +0000
(11:40 -0700)
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/ls-files.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
6510ae1
)
diff --git
a/builtin/ls-files.c
b/builtin/ls-files.c
index b1626b13b43f3a69b35bc242c30a28b51a855306..927aa67469d8d2bb8919d2b0b392313999bdfbec 100644
(file)
--- a/
builtin/ls-files.c
+++ b/
builtin/ls-files.c
@@
-232,7
+232,8
@@
static void show_gitlink(const struct cache_entry *ce)
exit(status);
}
exit(status);
}
-static void show_ce_entry(const char *tag, const struct cache_entry *ce)
+static void show_ce_entry(const struct index_state *istate,
+ const char *tag, const struct cache_entry *ce)
{
struct strbuf name = STRBUF_INIT;
int len = max_prefix_len;
{
struct strbuf name = STRBUF_INIT;
int len = max_prefix_len;
@@
-276,7
+277,7
@@
static void show_ce_entry(const char *tag, const struct cache_entry *ce)
find_unique_abbrev(ce->oid.hash, abbrev),
ce_stage(ce));
}
find_unique_abbrev(ce->oid.hash, abbrev),
ce_stage(ce));
}
- write_eolinfo(
&the_index
, ce, ce->name);
+ write_eolinfo(
istate
, ce, ce->name);
write_name(ce->name);
if (debug_mode) {
const struct stat_data *sd = &ce->ce_stat_data;
write_name(ce->name);
if (debug_mode) {
const struct stat_data *sd = &ce->ce_stat_data;
@@
-352,7
+353,7
@@
static void show_files(struct dir_struct *dir)
continue;
if (ce->ce_flags & CE_UPDATE)
continue;
continue;
if (ce->ce_flags & CE_UPDATE)
continue;
- show_ce_entry(ce_stage(ce) ? tag_unmerged :
+ show_ce_entry(
&the_index,
ce_stage(ce) ? tag_unmerged :
(ce_skip_worktree(ce) ? tag_skip_worktree : tag_cached), ce);
}
}
(ce_skip_worktree(ce) ? tag_skip_worktree : tag_cached), ce);
}
}
@@
-370,9
+371,9
@@
static void show_files(struct dir_struct *dir)
continue;
err = lstat(ce->name, &st);
if (show_deleted && err)
continue;
err = lstat(ce->name, &st);
if (show_deleted && err)
- show_ce_entry(tag_removed, ce);
+ show_ce_entry(
&the_index,
tag_removed, ce);
if (show_modified && ce_modified(ce, &st, 0))
if (show_modified && ce_modified(ce, &st, 0))
- show_ce_entry(tag_modified, ce);
+ show_ce_entry(
&the_index,
tag_modified, ce);
}
}
}
}
}
}